I am developing an app in AppBasic, and trying to use BasAlt's dynamic
arrays, but finding it hard to use.
You need to have this as the FIRST effective line of code:
*BasaltInit
how do I achieve this from within AppBasic?
i have tried compiling to single file, and I get "Bad DIM Statement at
line 40" which is:
DIM Wimp% 512,ID%,24
for now I am sticking with hard coded sizes, but would prefer to use
dynamic arrays to reduce memory foot print.
Cheers
Some mistakes are better than others, the DIM line as quoted actually works
perfectly with Basalt.
This code fragment using the DIM from AppBasic does fall over with the Bad
DIM :-
*BasaltInit
ON ERROR PRINT REPORT$ + "at line "+STR$ERL:END
DIM WIMP% 512,ID% 24
The problem is the variable WIMP% clashes with Basalt's keyword WIMP.
--
David Pitt
Snow Leopard - MessengerPro
Cheers David!
I will do a global replace to change WIMP% to something like Wimp% and
test it :@), I had a feeling it was the WIMP%
it becomes very useful when dealing with 10 arrays, as I have had to
hard code them to 99,999 elements, but in reality I am only ever using
17,000 elements, and in testing, only around 20, yet some people may
have more than 100,000 tracks (if there is, I'd like to know how many
duplicates they have!)
Is there a way to use BasAlt with AppBasic, without compiling to one
file?
> Michael wrote: I didnt even realise I was up at that time! no wonder I
> wasn't concentrating!
>
Yes, I did notice that. I'm lucky I do not have to stay up late to make
mistakes, I can get it wrong at any time of day.
> > *BasaltInit
> > how do I achieve this from within AppBasic? i have
> > tried compiling to single file, and I get "Bad DIM Statement at
> > line 40" which is:
> > DIM Wimp% 512,ID%,24
> > for now I am sticking with hard coded sizes, but would prefe to use
> > dynamic arrays to reduce memory foot print.
>
> Some mistakes are better than others, the DIM line as quoted actually works
> perfectly with Basalt.
>
> This code fragment using the DIM from AppBasic does fall over with the Bad
> DIM :-
>
> *BasaltInit
> ON ERROR PRINT REPORT$ + "at line "+STR$ERL:END
> DIM WIMP% 512,ID% 24
>
> The problem is the variable WIMP% clashes with Basalt's keyword WIMP.
Thanks for identifying that. This sort of problem can happen with plain
BASIC too, when a variable name begins with the characters of a
keyword, which then gets tokenised; ISTR that there is even a warning
about it in the BASIC manual. My policy is to only /start/ global
variables with uppercase, and to keep local variables to lowercase.
BTW For those who might want to know, the WIMP keyword returns the
machine's Wimp version after an application has been initialised to use
the Toolbox. Basalt supports the Toolbox in a object-oriented manner,
but has nothing approaching the support materials of AppBasic.
--
; ,', * Basalt * - gives RO 3.10+ versions of BASIC V new and alternative
;,' keywords, dynamic memory for arrays and blocks, new variable types.
;', Legal, fast and simple to use. Freeware - version 0.98� - 19 Aug 03
,; ',, Steve Drain, Kappa : http://www.kappa.me.uk/basalt.htm
ATM (Basalt v0.98) uses the application memory, with a dynamic heap
above HIMEM, and this will limit the total size of arrays. If a
significant number of your 10x100,000 arrays are of strings you could
hit the 26M limit. I did the work to put very large arrays in dynamic
areas, where you would only be limited by the memory in the machine.
Would this be useful? I do know that might use up the address space.
> Is there a way to use BasAlt with AppBasic, without compiling to one
> file?
I do not know enough about how AppBasic works. If it just uses
libraries that would be ok, but if it changes HIMEM to make room for
them, then that would break Basalt. There is also a problem if it offers
crunching, because the new keywords would be lost unless they are made
exceptions. Also, if you want libraries with Basalt keywords you must
use the new LIBRARY /function/ to load them.
This would be very useful, as although I wouldn't pass the memory size
(well I haven't as of yet), I am guessing others would.
>
> > Is there a way to use BasAlt with AppBasic, without compiling to one
> > file?
>
> I do not know enough about how AppBasic works. If it just uses
> libraries that would be ok, but if it changes HIMEM to make room for
> them, then that would break Basalt. There is also a problem if it offers
> crunching, because the new keywords would be lost unless they are made
> exceptions. Also, if you want libraries with Basalt keywords you must
> use the new LIBRARY /function/ to load them.
I am unsure of how AppBasic starts the actual programme.
At the moment I am compiling down to one file (so no crunching nor
library files used) when I add in the Basalt hooks, so it isn't an
issue at the moment, but means until I have finished testing, I need
to ignore basalt, which is a bit of a bugger.
Both programming aids are great by the way!
<plug="Basalt":>
>
> --
> ; ,', * Basalt * - gives RO 3.10+ versions of BASIC V new and alternative
> ;,' keywords, dynamic memory for arrays and blocks, new variable types.
> ;', Legal, fast and simple to use. Freeware - version 0.98ß - 19 Aug 03
> ,; ',, Steve Drain, Kappa :http://www.kappa.me.uk/basalt.htm
<plug="AppBasic">
http://appbasic.jettons.co.uk/