Latest Uploads
image-15-0 ... -19-40.jpg


image-15-0 ... -20-07.jpg


Bumble Bee




Guess The Remake


Julia Set Visualer


Forum Home

array Problem

Posted : Saturday, 07 January 2012, 19:06 | Permalink


I'm trying to pass an array into a function and change certain characters within the string.

This code is giving me an error. Is it the square bracket?


Posted : Sunday, 08 January 2012, 12:00 | Permalink | Mark Here

WW Entries : 1
Hey dna,
I think it is the assignment to Mid$ that doesn't work:


Should be something like:
E$[J] = Left$(E$[j],S-1) + "/" + Mid$(E$[j],S+1)
Homepage :
Posted : Sunday, 08 January 2012, 20:54 | Permalink | Mark Here

A type mismatch now


The dim does not work.

Does Blitz pass string arrays?

Posted : Monday, 09 January 2012, 16:04 | Permalink | Mark Here
Evil Roy Ferguson

WW Entries : 3
Blitz's array support is anemic. You can pass string arrays to methods, but the so called "blitzarrays" break if you specify the type anywhere but declaration. That is to say, the following will work:


No idea what you're doing, though...
Posted : Monday, 09 January 2012, 19:15 | Permalink | Mark Here

Thanks Evil One

Still, It compiles but does not pass the array.

Must be some funny syntax.

the program will replace any occurrence of Upper or Lower case B with a "/".

From there it will do something else.

I might be able to get the result using integers instead of passing the string to the function. Just compare the integer to the "/" equivalent.

Posted : Monday, 09 January 2012, 22:13 | Permalink | Mark Here

I'm no Blitz expert, so apologies if this is utter crap.

It seems to me you could wrap the string array in a custom type.
This would be passed by reference, e.g.

Posted : Tuesday, 10 January 2012, 19:27 | Permalink | Mark Here

That probably is the best method (no pun) for doing what I'm attempting.

I did want to know the square bracket string array syntax though.

Posted : Tuesday, 10 January 2012, 20:05 | Permalink | Mark Here

I guess if you use that method, you may as well not use an array at all.
i.e. just use the built-in type iterators. They're stored in a linked-list, so effectively you'd have a dynamic array.
Posted : Tuesday, 10 January 2012, 20:53 | Permalink | Mark Here

You are right again but the algorithm was created to test the use of passing those square bracket arrays.

It's undocumented in some versions of BB

I'll learn types then.

Posted : Tuesday, 10 January 2012, 21:05 | Permalink | Mark Here
Evil Roy Ferguson

WW Entries : 3
Passing in the array works; the line doing it was just commented out in your example above and I did not change it back.
Posted : Tuesday, 10 January 2012, 21:31 | Permalink | Mark Here

I removed the comment and the string array did not pass. I got a Variable type mismatch error.

Posted : Tuesday, 10 January 2012, 22:42 | Permalink | Mark Here
Evil Roy Ferguson

WW Entries : 3
That's because you're passing in a single element of the array with INS(R[0]) instead of the array, when what you need is just INS®. You also can't print the result of that, since it doesn't return anything.
Posted : Wednesday, 11 January 2012, 21:52 | Permalink | Mark Here

Found my syntax error

This is right.

Posted : Thursday, 12 January 2012, 02:36 | Permalink | Mark Here

Can't you just use the Replace$ function?

Posted : Thursday, 12 January 2012, 11:54 | Permalink | Mark Here

Yes I could have.
I never knew the command existed before. That looks easier than using the mid$ function.
What I wrote is probably the same somewhere inside the REPLACE function.

Posted : Thursday, 12 January 2012, 17:13 | Permalink | Mark Here

Unlikely. The library functions would be C/C++ not BlitzBasic.
Posted : Thursday, 12 January 2012, 19:02 | Permalink | Mark Here

You're right again but I meant the logistics of how it works.
thanks for pointing that out to me.
I have never really read the B3D manual.

Latest Posts
Wordpress Forwarding...
Jayenkai Fri 05:15
RIP Robin Williams
dna Thu 12:00
The Eternal Struggle Between Man and CSS
spinal Thu 11:19
AGameAWeek Progress Report
Jayenkai Thu 06:59
OUYA Plays AGameAWeek
Jayenkai Wed 02:25
New Server : Tests, Complaints, Arguments and More!
Jayenkai Tue 07:09
File Error
Jayenkai Mon 14:11
Be Safe. Trust No One
Jayenkai Mon 13:21
They Are Everywhere Gameplay Video at 2x Speed!
rychan Mon 06:19
Monkey vs Unity 2D
GfK Sat 09:09

Latest Items
Blog : Health Update : August 2014
Jayenkai Fri 05:17
Showcase : Space Rocket Adventurers
Jayenkai Wed 08:26
Blog : 20 Years Ago....
Jayenkai Sat 09:17
Techy : Back from Game Dev Con!
Jayenkai Sun 16:52
Family : Sunday
Jayenkai Wed 03:31
Family : Good News (for once)
Kuron Tue 15:37
Showcase : Don't Tap The Zombies
therevillsgames Mon 16:26
Showcase : Mutant Monty
steve_ancell Wed 19:26
Blog : Update
Kuron Mon 13:52
Techy : New Laptop!?
Kuron Fri 15:52
Showcase : Ascension 2 Live Wallpaper
CodersRule Fri 13:48
Showcase : Saviors of Gundthor
CodersRule Fri 12:50
Showcase : Lava Monkey
rychan Tue 16:13
Blog : Mac Rant!
rockford Fri 14:48
Dev-Diary : Yup, another song
Kuron Wed 06:39

Who's Online
Fri, at 05:43
Fri, at 05:42
Fri, at 05:31
Fri, at 03:59
Fri, at 02:34
Fri, at 01:22
Thu, at 20:19
Thu, at 19:47
Thu, at 15:58
Thu, at 13:32
Link to this page
Site : Jayenkai 2006-Infinity | MudChat's origins, BBCode's former life, Image Scaler.