![]() |
Record Arrays - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10) +---- Thread: Record Arrays (/showthread.php?tid=2844) |
Record Arrays - Kernelpanic - 07-01-2024 So, using arrays as record elements is not possible in QB. OK, but declaring record arrays is also possible in QB. I've tried this according to the QBasic manual, only a rudimentary guide, but something isn't working. The program runs without errors, but there is no meaningful output. I'm thinking wrong. Code: (Select All)
![]() Does anyone know where the error is? Thanks! RE: Record Arrays - DSMan195276 - 07-01-2024 If you add `Optiion _Explicit` to your program you might realize what the issue is ![]() Your input lines should be using names similar to `MotorradMarken(satzNummer).Modell` for each line, so that the input is read into the array entries. With what you have right now, `Motorrad.Modell` is just treated like the name of a regular variable and QB64 simply creates the `Motorad.Modell` variable for you with the default `Single` type, completely separate from the array you declared. RE: Record Arrays - bplus - 07-01-2024 missing index too in the inputs this is fixed unless you want to actually input 2 sets of data Code: (Select All) Type Motorrad RE: Record Arrays - TerryRitchie - 07-01-2024 (07-01-2024, 08:48 PM)DSMan195276 Wrote: If you add `Optiion _Explicit` to your program you might realize what the issue isNEVER write QB64 programs without the first line of your code being: OPTION _EXPLICIT I have been saved countless times from typos by this one line of code. It should be the default behavior of the IDE (in my opinion) with an option to turn it off when viewing QB64 or legacy code written by someone else that didn't use it: _EXPLICIT _OFF for example. RE: Record Arrays - Kernelpanic - 07-01-2024 Thanks for the answers. I'll look into it tomorrow... I think I've had one glass of wine too many today. ![]() RE: Record Arrays - Jack - 07-01-2024 there's always room for one more glass ![]() RE: Record Arrays - Kernelpanic - 07-02-2024 Thanks again for the tips, I was totally off track yesterday. Now it works also with the display of the book in question. It's not really "practical" yet, but it works. Code: (Select All)
Show picture. Code: (Select All)
Display: ![]() ![]() |