News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

Expression I can put a 1 character string

Started by Giuseppe, Feb 24, 2025, 08:28 PM

Previous topic - Next topic

Giuseppe

Hi, I wanted to ask if in a select like Expression I can put a 1 character string, I put the code below.

Dim cmdStr            As String * 6
Dim cmd_1             As String * 1

Proc actuator()
RsOut 0,cmdStr
cmd_1 =Mid$(cmdStr,4,1)
RsOut 0,cmd_1

Select cmd_1
Case "A"
GoTo azione_tre     
Case "B"
GoTo azione_quattro
Case "C"
GoTo azione_cinque 
Case "D"
GoTo azione         
Case "E"
GoTo azione_uno     
Case "F"
GoTo azione_due     
End Select
ExitProc


John Drew

Yes, case "A" is interpreted as case 65.
It's a character in this situation rather than a string.
John

Giuseppe