Contents | Index | < Browse | Browse >
LVMulti First|Next|On|Off|All|None|Show
This allows you to read the selections made on multiple and directory
listviews. It will act on the CURRENT LISTVIEW.
The First & Next keywords are the ones that do this.
You MUST start with :
- LVMULTI FIRST
This will store into the given ListView's variable, the text of the
first selection in the list. (or "" i.e. nothing, if there is none).
Thereafter you read selections in some kind of loop, usually using the
WHILE/ENDWHILE commands :
- LVMULTI NEXT
This will store the next selection into the listview's variable.
You will call this many times, until it stores a "" (i.e. nothing)
into the variable, whereby you know that the selections have finished.
Example : (Filename = MyGui)
-------------------------------------------------------
G4C
WinBig -1 -1 320 100 "My Directory"
xListView 10 10 200 100 "" LVar dh0:MyDir 10 DIR
GadID 1
xButton 210 10 100 15 "List Selections"
LVUse MyGui 1 ; use the above LV
LVMulti First ; goto the 1st selected record
while $$lv.line > "" ; while there are records
Say '$LVarn' ; print it
LVMulti Next ; goto next selected record
EndWhile ; close while loop
-------------------------------------------------------
The rest of the keywords have the following meanings :
ON : set current line ON (select it)
OFF : set current line OFF
ALL : select *all* the lines of the LV
NONE : un-select all lines
SHOW : redraw the LV. This is important in speeding up
lv processing. It is *much* faster to HIDE an lv
(with SetGad) and act on it (with lvadd, lvput etc)
and then SHOW it again, than to have the LV updated
continuously while actions are going on. When you show
it again, you must "nudge" it into redrawing itself
with LVMulti SHOW (can also be done with LVMOVE 0)
-------------------------------------------------------
*** Not Implemented yet ***
Many programs can take myltiple files as arguments, so there
is no need to feed each file one by one to them.
By using these two, the DirListView's Variable will be filled with
all selections made (i.e. the file names you've selected, listed
one after the other), until the first xxx bytes (ex: First_910)
of your "buffer" are full.
By default, the "Buffer" in Gui4Cli is 1024 bytes. This means your
variables can not have more than 1024 characters (spaces inclusive).
The buffer size can be changed with the "ToolTypes and Options".
So when executing a command line you would give a command :
CLI 'MyProgram $MyFiles $Option1 $Option2 etc etc'
Here, you must calculate approximately the size that the program name
and all the other options will take up in the command line, and ask
for First_xxx Next_xxx number of bytes in the $MyFiles variable to
be filled, so that the complete resulting command line fits into
the 1024 bytes (or whatever) buffer available.
You got all that ?