Oshonsoft Functions and Variables

Thread Starter

camerart

Joined Feb 25, 2013
3,830
Hi,
I'm trying to figure out some CODE I've been sent for a project.
============================================
If (getMS - tickSerial) > 1000 Then
'this code executed every 1000mS
tickSerial = getMS
str = "$test stringW" 'Here STR is a VARIABLE this string cannot be more than 15 characters long or the servos may glitch
For i = 0 To Len(str) - 1
Call putFifo(str(i)) 'Here STR is a FUNCTION shown by ()
Next i
Endif
=================================================
It's just been explained to me that the blue STR is a Variable and the Red STR is a Function!
Am correct in guessing that the Orange one is a Variable?
Camerart
 

jjw

Joined Dec 24, 2013
823
The putFifo() is a procedure.
The str(i) is a parameter ie. input to the procedure.
It is the i'th character of the string str.
 
Last edited:

Thread Starter

camerart

Joined Feb 25, 2013
3,830
Hi,
I get lots of CODE written for me, which allows me to do projects well above my level.
Many CODErs use the same name for multiple things, which is confusing. i,e, (i) is used all over the place, and it changes at each use throughout the CODE. Very confusing, but appreciated.
C
 

Ya’akov

Joined Jan 27, 2019
10,235
str is always a variable, but OshonSoft BASIC allows you to treat strings as byte arrays, so:
str(n)
returns the nth element of str as an array. So, it’s always a variable, but it is two different types.
 

Thread Starter

camerart

Joined Feb 25, 2013
3,830
str is always a variable, but OshonSoft BASIC allows you to treat strings as byte arrays, so:
str(n)
returns the nth element of str as an array. So, it’s always a variable, but it is two different types.
Hi Y,
For my skill level, this will take a long time to reduce the confusion.
C
 
Top