![]() maybe the procedure didn't add any element. ArraySize() will return 0 regardless of the return value of the procedure. the first element created during dim'ing. but if the array is 0-indexed, there will always be that a(0) i.e. but you don't know what the final size of the array is going to be! that's what a dynamic array is for! if it is something returned from a procedure, you will want to check if there's any element in the array. it must be dim a(0) or some other positive number instead of 0. to declare a dynamic array, you must specify a size (unlike in vb6). *there's no way AFAIK to check if a dynamic array is empty in purebasic if you start from the index 0. seems like i've forgotten how looping through an array worked in VB6, lol. ![]() I guess this is in conforming with QBASIC/VB6 syntax. ArraySize of 0 would mean there's one element in an array. ![]() *ArraySize() gives the size of the array AS SPECIFIED WITH DIM OR REDIM. shows the language is geared towards not doing that. *confusing syntax, especially with EnableExplicit on. *messy array/pointer/list returning from procedures. documentation is good and beginner-friendly most of the time though.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |