I found a bug, how i can solve this problem with the open square bracket?
code.
cc="(Kr) 4d8 5s1"
ces=ReplaceStr(cc,"(","\[")
ces=ReplaceStr(cc,")","\]")
DebugPrint(ces)
output.
(Kr] 4d8 5s1
bug found with square bracket
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: bug found with square bracket
Huh, why are you escaping the square bracket? That shouldn't be done. Is that what you're looking for?
Code: Select all
cc="(Kr) 4d8 5s1"
ces=ReplaceStr(cc,"(","[")
ces=ReplaceStr(ces,")","]")
DebugPrint(ces)
-
- Posts: 267
- Joined: Fri Feb 24, 2012 9:34 am
Re: bug found with square bracket
hello andreas, if i don´t escape i have this error, the item is in a table
item to print ---->[Ar] 3d5 4s2
Error in line 684 (Taula.hws): Text format tag after square bracket not recognized!
item to print ---->[Ar] 3d5 4s2
Error in line 684 (Taula.hws): Text format tag after square bracket not recognized!
-
- Posts: 267
- Joined: Fri Feb 24, 2012 9:34 am
Re: bug found with square bracket
i test with a table alone now and the result is the same, error
code:
ces={}
ces[0]="[Kr] 4d8 5s1"
DebugPrint(ces[0])
Print(ces[0])
debug:
Error in line 4 (Unnamed1): Text format tag after square bracket not recognized!
code:
ces={}
ces[0]="[Kr] 4d8 5s1"
DebugPrint(ces[0])
Print(ces[0])
debug:
Error in line 4 (Unnamed1): Text format tag after square bracket not recognized!
Re: bug found with square bracket
I can't test this right now, but I think the way I've done it before was to replace "[" with "[[" and replace "]" with '']]" (double brackets).
-
- Posts: 267
- Joined: Fri Feb 24, 2012 9:34 am
Re: bug found with square bracket
thanks for your repply Peb, this is working fine with your method!
code:
electroconfigsemantic="[Ar] 3d10 4s2 4p2"
ss=ReplaceStr(electroconfigsemantic,"[","[[")
ss=ReplaceStr(ss,"]","]]")
debugprint result ---> [[Ar]] 3d10 4s2 4p2
textout result ----->[Ar] 3d10 4s2 4p2
interesting
code:
electroconfigsemantic="[Ar] 3d10 4s2 4p2"
ss=ReplaceStr(electroconfigsemantic,"[","[[")
ss=ReplaceStr(ss,"]","]]")
debugprint result ---> [[Ar]] 3d10 4s2 4p2
textout result ----->[Ar] 3d10 4s2 4p2
interesting
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: bug found with square bracket
It's all documented here. Quote:
So not a bug.Please note that because of these format tags you have to use two square brackets if you want to have a square bracket in your text. If there is only one square bracket Hollywood will always expect a format tag.
-
- Posts: 267
- Joined: Fri Feb 24, 2012 9:34 am
Re: bug found with square bracket
correct, the problem is solved, thanks again.