Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ascii Numbers
#1
I'm trying to find out what characters are terminating a line so i can write a regex script but i cant figure out what its using.

is there a function that will give me the ascii number for each character in a string?
An old blog on QM coding and automation.

The Macro Hook
#2
Macro
Code:
Copy      Help
str s="ABC[]DEF"
int i
for i 0 s.len
,out s[i]
#3
Also i often use this function:
Function outb
Code:
Copy      Help
;/
function !*ptr nBytes [flags] ;;flags: 1 show characters too

out _s.encrypt(8 _s.fromn(ptr nBytes) "" 1)
if(flags&1)
,str s.all(nBytes*3 2 32)
,int i c
,for(i 0 nBytes)
,,c=ptr[i]
,,if(c<32) continue
,,s[i*3+1]=c
,out s

Good for strings and for binary data.

Example
Macro
Code:
Copy      Help
str s="ABC[]DEF"
outb s s.len 1

Here character codes are in hex
#4
thanks!
i hate unix->windows stuff!
An old blog on QM coding and automation.

The Macro Hook


Forum Jump:


Users browsing this thread: 1 Guest(s)