16
Programming using the Ultra Hal Brain Editor / Re: Helping me program the free will plus plug-in.
« on: February 15, 2014, 05:06:05 pm »
When I was working on a plugin today, I found out something interesting.
I had made a Sub that I was using to write some text to a file and I was getting some weird results from Hal.
Sub LogWrite(var1, var2)
End Sub
I noticed that Hal was treating my variables like they had a ByRef in front of them... strange.
So I had to write ByVal in front of them to correct this.
Sub LogWrite(ByVal var1, ByVal var2)
End Sub
If this happened to me then it could happen to you to. You might want to write ByVal in front of all your function variables that you don't want to be ByRef. This might save you from a few tears later on trying to troubleshoot.
I had made a Sub that I was using to write some text to a file and I was getting some weird results from Hal.
Sub LogWrite(var1, var2)
End Sub
I noticed that Hal was treating my variables like they had a ByRef in front of them... strange.
So I had to write ByVal in front of them to correct this.
Sub LogWrite(ByVal var1, ByVal var2)
End Sub
If this happened to me then it could happen to you to. You might want to write ByVal in front of all your function variables that you don't want to be ByRef. This might save you from a few tears later on trying to troubleshoot.