I'm glad to see Steve's apple crop is coming in nicely, but out out here in CA working with oranges!
For some of my apps I use arrays, for some databases, and for some I use data statements. I mentioned apples and oranges because I was using data1, data2, and data3 as labels. Steve is using three data statements followed by numbers.
TDarcos posted what I posted on the previous page, the Select Case method to use Restore.
So basically for user input routines, we can have...
Pete
For some of my apps I use arrays, for some databases, and for some I use data statements. I mentioned apples and oranges because I was using data1, data2, and data3 as labels. Steve is using three data statements followed by numbers.
TDarcos posted what I posted on the previous page, the Select Case method to use Restore.
So basically for user input routines, we can have...
Code: (Select All)
Print "Who do you wish to consult?"
Do
Input "1) for Pete, 2) for Steve, or 3) for Past Presidents"; x
Print
' So while we can't do this, so far, in QB64: On x Restore data1, data2, data3
' We can do this with Select Case...
Select Case x
Case 0: End
Case 1: Restore data1
Case 2: Restore data2
Case 3: Restore data3
Case Else: Run
End Select
Do
Read Consultant$, blurb$
If Consultant$ = "eof" Then Exit Do
Print Consultant$; ": "; blurb$
Loop
Print
Loop
data1:
Data Pete,Likes On x Restore
Data Pete,Likes stirring the pot even more!
Data eof,
data2:
Data Steve,Likes using arrays.
Data Steve,Has his own ass but prefers to ride Pete's.
Data eof,
data3:
Data President Trump,More jobs!
Data President Obama,No jobs!
Data President Clinton,Blow jobs!
Data President Biden,Nut jobs!
Data eof,
Pete