'From Main Module
' Data type for truck list array
'Initialize truck list from truck.txt
IF LOF(3) = 0 THEN 'TRUCK.TXT is empty/not present truck(1).trucknm = "default" 'create blank truck record
truck(1).tare = 0
ELSE 'TRUCK.TXT is present y%
= LOF(3) / LEN(truck
(0)) 'retrieve truck records
'Initialize farm list into farmindex array
IF LOF(4) = 0 THEN 'FARM.TXT is empty/not present farmindex(1) = "Main" 'create blank farm record
ELSE 'FARM.TXT is present y%
= LOF(4) / 20 'retrieve farm records
'End Main Module code
'This code executed in SUB ConfigRun which runs in a
'_NEWIMAGE (50, 20, 0)screen
LOCATE x
+ 2, 25 - (LEN(farmindex
(x
)) / 2) 'center justify
Mouse_Loop 0, 0
cho%
= Mouse_Point%
(2, UBOUND(farmindex
), 20, 30)'It refuses to print the last farmindex value. I added a dummy
'value at the end of the file to make it do so as a work around.
'Then this one from SUB TruckIn same screen parameters
IF editmode
AND var.truck
= truck
(x
).trucknm
THEN COLOR 14 'original truck in yellow IF mouse_x
= x
+ 4 THEN COLOR 12, 0 'mouseover highlight
Mouse_Loop 0, 0
cho%
= MousePoint%
(4, UBOUND(truck
), 14, 24)
'It throws a subscript out of range error at MousePoint% call
'including the Mouse_Loop and MousePoint% in case of relevance
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' SUB: Mouse_Loop
'
' Purpose:
' Primary mouse input loop. Controls mousewheel scrolling and conditions
' x,y position data.
'
' Passed Variables:
' var sends whether data list is extensive enough for using offset printing values
' var2 sends maximum allowed offset value
'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'scan for changes in mouse position and save to global variables
offset
= offset
+ _MOUSEWHEEL 'mousewheel offset only works in the loop IF offset
< 0 THEN offset
= 0 'otherwise would SUB to Mouse_Loop IF offset
> var2
THEN offset
= var2
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' FUNCTION: Mouse_Point%
'
' Purpose:
' Returns the row position and column range of a mouse pointer on left click.
' Used for drop down choice routines.
'
' Passed Variables:
' trim_top sends value to be trimmed from row position to mark start of data list
' last item sends value of last data item displayed
' left_x sends leftmost allowed point of selection of data element
' right_x sends rightmost allowed point of selection of data element
'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
ypos = mouse_y - trim_top
IF mouse_x
> left_x
AND mouse_x
< right_x
THEN Mouse_Point% = ypos