{$A+,B-,D+,F+,G-,I+,L+,N-,R+,S+,V+,W+,X+}
{$M 8192,0}

PROGRAM ListStringsInResource;

{$R ..\PCFDIAL\PCFDIAL.RES}   {CHANGE THIS to the resource you want to inspect!}

   {A public domain program from Rob Rosenberger (who?)
                                 P.O. Box 643
                                 O'Fallon, IL 62269
                                 CompuServe 74017,1344
    Version 1.00 released on September 6, 1991.

   This cute little program serves one VERY useful purpose: it lets you see
all the strings in a given resource file.  The program sends strings to the
screen by default, but you can "uncomment" two lines of code so it will save
the strings in a file.
   String resources prove extremely useful in a WinApp because you can easily
save all the strings outside the boundaries of your executable code.  This
lets you change them without having to recompile the program -- useful if you
want to offer English and German editions of your WinApp.  See page 376 of the
TPW Cookbook for further details on the usefulness of string resources.
   I use this little ditty to save a copy of my strings to a file so I don't
have to retype them in my documentation file.  You may of course find other
uses for it.  Enjoy!}

USES
   STRINGS,
   WINCRT,
   WINPROCS;


VAR
   Index   : WORD;
   TempStr : ARRAY [00..255] OF CHAR;


BEGIN {ListStringsInResource}
{Uncomment these two lines to save the strings in a file.}
(*
ASSIGN(OUTPUT,'RESOURCE.STR');
REWRITE(OUTPUT);
*)

FOR Index := 1 TO 65534
 DO BEGIN
    LoadString(HInstance,Index,@TempStr,SIZEOF(TempStr));
    IF (STRLEN(TempStr) > 0)
     THEN WRITELN(OUTPUT,Index,' = ',TempStr)
    END; {FOR}

{Wrap up.}
CLOSE(INPUT);
CLOSE(OUTPUT)
END. {ListStringsInResource}
