I wrote this program as a learning exercise, to learn how queues work, how to read and write INI files and plain text files (using stringtheory)
I also learnt how to edit the values in a list and update the queue. Many thanks to all the people who generously helped me by answering newbie questions, especially @MarkGoldberg for his code review and debuger code
You declare variables and then use the as USE attribute in your control definitions.
`
SearchString cstring(41)
ReplaceString cstring(41)
No long ! I’d probably use a different variable name
ENTRY(@s40),AT(17,115,99,10), USE(SearchString),MSG('Use this to edit the search string')
ENTRY(@s40),AT(119,115,98,10),USE(ReplaceString),MSG('Use this to edit the replace string')
ENTRY(@N4),AT(221,115,36,10), USE(No),MSG('Use this to edit a particular entry')
`
Then in your code you can use the variables to get the values from the control.
`
If No = 42
!Do something
end
`
If you want to manipulate the control then use the ? syntax.
PROGRAM
MAP
END
mynumber SHORT
Window WINDOW('Caption'),AT(,,236,221),GRAY,FONT( 'SegoeUI',9)
BUTTON('&OK'),AT(19,62,41,14),USE(?OkButton),DEFAULT
BUTTON('&Cancel'),AT(69,62,42,14),USE(?CancelButton)
STRING( 'Myfavourite number:'),AT(2,15),USE(?dispstr)
ENTRY(@n4),AT(79,15),USE(mynumber)
END
CODE
open(window)
ACCEPT
case accepted()
of ?mynumber
message( 'yourfavourite # is ' &mynumber)
of ?OkButton
close(window)
end
end
You have the beginning of some nice functions. It would be good to test for errors and respond to them.
e.g. in ProcessAllFiles, you call GetAllFiles. What if there’s a problem with GetAllFiles? You wouldn’t want to proceed if there was.
I’d have an error test after COPY(), ST.LoadFile, and ST.SaveFile as well.
I didn’t read all of the code, but those are things I noticed.
Also, my personal preference would be to copy the files to a separate folder for processing and leave the source folder intact.
There’s a function called fnsplit() as defined in libsrc\CLIB.CLW That might be useful to you.