Post by hinton123 on Feb 7, 2021 11:11:01 GMT -5
Hi, absolute beginner here.
Is there a way to create a COMBOBOX with more than 10 fields in the list?
In this code, I'm pulling records from a Random Access File and putting the CarName$ Variable in a list for the ComboBox. After looking at the debug it looks like my while loop stops after 10 loops as if the array for the combobox can only store 10 fields. When I run the below code a get a 'Subscript Out of Range:11' Runtime error. (v4.5.1)
Sorry if I have used incorrect terms.. hope this makes sense. I have absolutely 0 programming knowledge and only started learning Liberty BASIC less than a week ago
TIA!
Is there a way to create a COMBOBOX with more than 10 fields in the list?
In this code, I'm pulling records from a Random Access File and putting the CarName$ Variable in a list for the ComboBox. After looking at the debug it looks like my while loop stops after 10 loops as if the array for the combobox can only store 10 fields. When I run the below code a get a 'Subscript Out of Range:11' Runtime error. (v4.5.1)
Sorry if I have used incorrect terms.. hope this makes sense. I have absolutely 0 programming knowledge and only started learning Liberty BASIC less than a week ago
TIA!
UpperLeftX = (DisplayWidth - WindowWidth) / 2
UpperLeftY = (DisplayHeight - WindowHeight) / 2
WindowWidth = 400
WindowHeight = 300
'opens window with combo box
OPEN "C:\Users\hamme\Desktop\Drift_Tune_Settings.dat" FOR RANDOM AS #settings LEN = 61
FIELD #settings, 25 AS CarName$, 6 AS FrontARB$, 6 AS RearARB$, 6 AS FrontDamp$, 6 AS RearDamp$, 6 AS FrontBump$, 6 AS RearBump$
LengthOfFile = LOF(#settings)
NewRecordPos = LengthOfFile / 61
STATICTEXT #existing.setuplist, "Please choose select a car:", 125, 10, 300 ,25
COMBOBOX #existing.setuplist, setuparray$(), [action], 40, 40, 300, 25
'pulls records from the RAF starting from record 1
I = 1
WHILE (I <= NewRecordPos)
GETTRIM #settings, I
setuparray$(I) = CarName$
I = I + 1
WEND
OPEN "Existing Setups" FOR WINDOW AS #existing
PRINT #existing, "Trapclose [quitexisting]"
WAIT
[action]
PRINT #existing.setuplist, "selection?"
INPUT #existing.setuplist, Selection$
K = 1
'searches through the setuparray and finds the approptriate name
WHILE (setuparray$(K) <> Selection$)
K = K + 1
WEND
GETTRIM #settings, K
Notice CarName$
wait
CLOSE #existing
CLOSE #settings