Variable into string confusion...

Hi Folks,


set az ao ASCII character 34 --\
set pinenter to theAnswer
set pass to "at+cpin=" & az & "pinenter" & az & "" & return
display dialog pass

This will show at+cpin=“pinenter” - as far as good - but how shall I manipulate this string if “pinenter” is a variable
which will be feed by


set theAnswer to text returned of (display dialog "Please enter the Pin..." buttons {"Cancel", "Proceed"} default answer "") & return


Thanks for your help, support, time and advice!

Stefan

Hi Stefan,

do you really want the return character directly after the entered text?
Anyway, you can use something like this (quote is a “shortcut” for ASCII character 34)

set pinenter to text returned of (display dialog "Please enter the Pin..." buttons {"Cancel", "Proceed"} default button 2 default answer "")
set pass to "at+cpin=" & quote & pinenter & quote & return
display dialog pass

Hi Stefan,

thanks - it works as I wanted it to work…


set az to ASCII character 34
set theAnswer to text returned of (display dialog "Please insert the Pin..." buttons {"Cancel", "Proceed"} default answer "") & return
set pinenter to theAnswer
set pin to serialport open modem
set pass to "at+cpin=" & az & pinenter & az & " " & return
serialport write pass to modem
display dialog pass
delay 3
serialport close modem