Function doesn't work

BlitzPlus Forums/BlitzPlus Programming/Function doesn't work

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

The following is a Function I wrote to strip decimals from a string of numbers:
Function StripDec(Q$)
Z=Instr(Q$,".",1)
X=Z-1
; PlaySound(sndBeep)
; WaitKey()
A$=Left$(Q$,X) < Puts Parameter must be Positive
PlaySound(sndBeep) on screen
WaitKey()
X=Len(Q$)
B$=Right$(Q$,X-Z)
Q$=A$+B$
Z=Int(Q$)
Z=100 * Z
Return Z
End Function
What parameters could this be looking for? Playsound & waitkeys are NOT apart of Function. Just used them to isolate problem. How can I solve this?