Page 2 of 2 <12
Topic Options
#156240 - 2006-01-30 02:23 AM Re: This type of array not supported
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Good call Jooel, No it does not error. So it is definatly something about how I wrote the line. Hmmm. What to do about that now. I will have to look at a different way of doing it.
_________________________
Today is the tomorrow you worried about yesterday.

Top
#156241 - 2006-01-30 02:56 AM Re: This type of array not supported
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
So, you're saying that the line:
$text = @CRLF + $Name[$PU,0] +" please share with " + $a + @CRLF
throws the error?

Weird. What if you cast to string?
$text = "" + @CRLF + $Name[$PU,0] +" please share with " + $a + @CRLF
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#156242 - 2006-01-30 05:05 AM Re: This type of array not supported
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
I was wondering if this is an issue of using a label to much. The $LabelG is used as a notification window within the game, and therefore I am changing the text in the label constantly.
Is it possible that I need to "reset" the label from time to time? If so what is the best way to do that.

Les, I will try that and let you know.


Shawn I know this is more appropriate for KFORG, but since the thread is already going here....
_________________________
Today is the tomorrow you worried about yesterday.

Top
#156243 - 2006-01-30 03:48 PM Re: This type of array not supported
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Okay Les, I tried as you suggested and got the same error.

I removed the $Name[$PU,0] and still got the error, then I removed the $a, and the error went away.

So now the question is why is $a giving me a problem... It is returned as VarType string, and it is giving me the expected result (a name)

Quote:

VarType for $a=String
Value=Cheryl





So I tried this .. $a = Cstr(PartnerSelect($PU))

Still got the error

So then I tried changing the line
$b = Willing($a)
to
$c = $a
$b = Willing($c)

Thinking that maybe the call to the Willing function was messing up $a, but that did not change the results either.

Then to further troubleshoot, I started printing $a after each step.

With that I got the expected results until I called the Willing($a) function.

Code:

Function Willing($Player)
For $ = 1 to $Count
If $Player = $Name[$,0]
$a = Split($Name[$,3],"~")
EndIf
Next
$Willing = $a
EndFunction



So I changed all of the $a in the function to $z and that has now resolved the problem.

I geuss this just goes to show that you must keep track of what variable is being passed where and doing what.

My only question then would be, I thought each function had its own exclusive variables, and would not change the variables that were used in other functions.
_________________________
Today is the tomorrow you worried about yesterday.

Top
#156244 - 2006-01-30 04:07 PM Re: This type of array not supported
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
You would have DIM $a in Willing() for that to work.
Top
#156245 - 2006-01-30 04:14 PM Re: This type of array not supported
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
As well I should and had planned on going back and doing all of those for each of the functions, just had not got around to doing it.

But to make sure that I understand, if I do not Dim a variable it should be considered to be global in nature, but if I dim it, it will be local to each function?
_________________________
Today is the tomorrow you worried about yesterday.

Top
#156246 - 2006-01-30 04:32 PM Re: This type of array not supported
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
right, and you can RETURN a locally dimmed variable (say, to a calling function), and not worry about it disappearing or anything.
Top
#156247 - 2006-01-30 08:44 PM Re: This type of array not supported
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
nice.
_________________________
!

download KiXnet

Top
Page 2 of 2 <12


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 128 anonymous users online.
Newest Members
SERoyalty, mytar, Gabriel, Alex_Evos, Dansen
17869 Registered Users

Generated in 0.06 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org