Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
case empty string
#1
This is simplified but I like to cycle through options in sqlserver such as ON/OFF, True/False, and so on but I'm having trouble converting two single quotes to the word NULL. By the way, if anyone can write a useful, practical book on Quick Macros I'll pay $100.

Macro Macro1
Trigger Am     Help - how to add the trigger to the macro
Code:
Copy      Help
key CSL
key Cc
str s.getsel
str b

b = s

out b

;cycle thru groups
sel b 9
,case "ON": b="OFF"
,case "OFF": b="ON"
,case "True" : b="False"
,case "False" : b="True"
,case "NULL" : b="[39][39]"
,case "''" : b="NULL"

out b

b.setsel
#2
I've tried several SEL option numbers and several different CASE strings to no avail. Maybe RegEx strings will work.
#3
Code:
Copy      Help
sel b 9
,case "ON": b="OFF"
,case "OFF": b="ON"
,case "True" : b="False"
,case "False" : b="True"
,case "NULL" : b="[39][39]"
,;case "[39][39]" : b="NULL" ;;QM bug: unescapes case strings 2 times
,case else if(b="[39][39]") b="NULL" ;;workaround


Forum Jump:


Users browsing this thread: 1 Guest(s)