Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ARRAY declaration in GOSUB routines.
#16
Wow I did not know that about erase in subs in main this works fine!
Code: (Select All)
Dim a(3)
a(1) = 1
Print a(1); "prints 1 with no error"
Erase a
Print a(1); "error! the array has been freed and erased in the SUB"

I've used erase quite a bit, guess it's always been with ones dim'd in main or shared from main. oh let's try that!

Code: (Select All)
Dim Shared a(3)
foo


Sub foo
    a(1) = 1
    Print a(1); "prints 1 with no error"
    Erase a
    Print a(1); "error! the array has been freed and erased in the SUB"
End Sub
yes, no problem sharing from main!

@Bartok maybe that will work for you?
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Messages In This Thread
ARRAY declaration in GOSUB routines. - by bartok - 02-04-2024, 01:05 PM
RE: ARRAY declaration in GOSUB routines. - by bplus - 02-05-2024, 02:20 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  getting the number of dimensions in an array on the fly? madscijr 7 743 09-16-2025, 12:34 AM
Last Post: madscijr
  Quesiton on Dimensioning an Array Dimster 5 1,000 02-06-2024, 01:55 PM
Last Post: Dimster
  Array in an array NasaCow 78 15,606 04-12-2023, 10:53 AM
Last Post: TempodiBasic
  Can images be read from a file into an array? PhilOfPerth 11 2,532 02-17-2023, 03:31 AM
Last Post: TerryRitchie
  Swapping array elements PhilOfPerth 24 3,915 11-19-2022, 12:16 AM
Last Post: Pete

Forum Jump:


Users browsing this thread: 1 Guest(s)