Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Array in an array
#11
Obligatory MySQL/SQLite suggestion.
Tread on those who tread on you

Reply
#12
(02-17-2023, 05:43 PM)Balderdash Wrote: Obligatory MySQL/SQLite suggestion.

Ah yes, we still await the tut! Smile maybe Terry?
b = b + ...
Reply
#13
(02-17-2023, 06:32 PM)bplus Wrote:
(02-17-2023, 05:43 PM)Balderdash Wrote: Obligatory MySQL/SQLite suggestion.

Ah yes, we still await the tut! Smile  maybe Terry?

I thought someone had already built an SQL library for QB64. Wasn't it steve? I know he built one for Dbase.
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply
#14
It would have been interesting if QB64 had to emulate more of what only BASIC v7.1 PDS offered such as ISAM. Smile

I had a great book about "advanced" programming on M$ BASIC, first focusing on QuickBASIC for windows, menu, mouse and sprite libraries, then switching to PDS to discuss ISAM. Honestly I wished I could have done something about databases back then but I have not reformed and still badly organized about certain data aspects. Had bad experiences with SQL or relative with a music instrument plug-in called Applied Acoustic Systems Tassman. Tremendous modular synthesizer, one of the earliest but had a poor preset organization system that caused the program to crash on occasion, and no hope of extensively modifying the most complex patches. Eventually the Canadian company declined making a next version 5 with VST3 64-bit support. :/
Reply
#15
(02-17-2023, 09:12 PM)TerryRitchie Wrote:
(02-17-2023, 06:32 PM)bplus Wrote:
(02-17-2023, 05:43 PM)Balderdash Wrote: Obligatory MySQL/SQLite suggestion.

Ah yes, we still await the tut! Smile  maybe Terry?

I thought someone had already built an SQL library for QB64. Wasn't it steve? I know he built one for Dbase.

That was Spriggsy.  Smile
Reply
#16
(02-17-2023, 10:57 PM)mnrvovrfc Wrote: It would have been interesting if QB64 had to emulate more of what only BASIC v7.1 PDS offered such as ISAM. Smile

I had a great book about "advanced" programming on M$ BASIC, first focusing on QuickBASIC for windows, menu, mouse and sprite libraries, then switching to PDS to discuss ISAM. Honestly I wished I could have done something about databases back then but I have not reformed and still badly organized about certain data aspects. Had bad experiences with SQL or relative with a music instrument plug-in called Applied Acoustic Systems Tassman. Tremendous modular synthesizer, one of the earliest but had a poor preset organization system that caused the program to crash on occasion, and no hope of extensively modifying the most complex patches. Eventually the Canadian company declined making a next version 5 with VST3 64-bit support. :/

I relied heavily on VBDOS' ISAM tools when I was a sysadmin for a company back in the 90's. I wrote custom software to track billing, sales, inventory, purchase orders, etc.. using shared ISAM databases on the Novell server I maintained. ISAM was a great database tool because it was simple to implement and maintain.
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply
#17
Could you not just keep all the data in comma delimited strings, and then just split them as you need them

that way there is no limit to the length of the strings and you can just add data to the end of the string giving unlimited results storage
Code: (Select All)
ReDim sData(0) as string
open "StudentData.csv" for input as #1
do
line input #1, sData(ubound(sData))
ReDim _Preserve sData(Ubound(sData)+1)
loop until eof(1)

input "Enter name or id to search for> ",s$
for i = 1 to ubound(sData)
if instr(sData(i),s$) > 0 then print sData(i)
next

Sub Str2arr (ST As String, AR() As String, DL As String)
    Dim Delim(Len(DL)) As String
    For i = 1 To Len(DL)
        Delim(i) = Mid$(DL, i, 1)
    Next
    'find first delim
    c = 1
    Do
        For i = 1 To UBound(Delim)
            If Mid$(ST, c, 1) = Delim(i) Then
                ReDim _Preserve AR(UBound(AR) + 1)
                c = c + 1
                Exit For
            End If
        Next i
        AR(UBound(AR)) = AR(UBound(AR)) + Mid$(ST, c, 1)
        c = c + 1
    Loop Until c > Len(ST)
End Sub
Reply
#18
(02-18-2023, 09:39 AM)AtomicSlaughter Wrote: Could you not just keep all the data in comma delimited strings, and then just split them as you need them

that way there is no limit to the length of the strings and you can just add data to the end of the string giving unlimited results storage
Code: (Select All)
ReDim sData(0) as string
open "StudentData.csv" for input as #1
do
line input #1, sData(ubound(sData))
ReDim _Preserve sData(Ubound(sData)+1)
loop until eof(1)

input "Enter name or id to search for> ",s$
for i = 1 to ubound(sData)
if instr(sData(i),s$) > 0 then print sData(i)
next

Sub Str2arr (ST As String, AR() As String, DL As String)
    Dim Delim(Len(DL)) As String
    For i = 1 To Len(DL)
        Delim(i) = Mid$(DL, i, 1)
    Next
    'find first delim
    c = 1
    Do
        For i = 1 To UBound(Delim)
            If Mid$(ST, c, 1) = Delim(i) Then
                ReDim _Preserve AR(UBound(AR) + 1)
                c = c + 1
                Exit For
            End If
        Next i
        AR(UBound(AR)) = AR(UBound(AR)) + Mid$(ST, c, 1)
        c = c + 1
    Loop Until c > Len(ST)
End Sub

Already offered the same idea in first reply: https://qb64phoenix.com/forum/showthread...7#pid13567

And here I improved the idea by dumping the delimiters and used fixed length segments into a fixed length "array" string so that the data record, UDT data, could actually be filed like a database record. https://qb64phoenix.com/forum/showthread...9#pid13599
b = b + ...
Reply
#19
(02-17-2023, 05:43 PM)Balderdash Wrote: Obligatory MySQL/SQLite suggestion.

There was something about this before: Database
In the thread, Pete also explained how to create a database in Basic, and in which you can also delete records. It is more complicated than in MySQL. I wanted to try it, but could not bring myself to do it until now.
A very important point in a database is the simple deletion of data records that have become obsolete. Sorting is also important: by name and/or by personnel number, by entry date, etc.
Reply
#20
@NasaCow
Is this your final goal?
PowerSchool Gradebook

In what measure do you want duplicate this program?

the picture that you showed at #1 is very simple  in respect to this second program.
Reply




Users browsing this thread: 10 Guest(s)