|Page 1 of 1|
|Author:||rustybucket323 [ Wed Mar 23, 2016 10:23 am ]|
I'm trying to create two programs and I'm stuck beyond no END.
I'm having the user read a line about "Peter" but then I want the program to change "Peter" to Paul. This is the code I've written so far.
f r !,"Enter a line about Peter: ",str q:str="" d
. s str=^XNAME(str)=""
f s str=$O(^XNAME(str)) q:str="" s $E(str,$F(str,"Peter")- $L("Peter"),$F(str,"Peter")-1) ="PAUL" w !,str
Any Thoughts would be greatly appreciated.
Character Counting in a string?
This is something That I just can not figure out.
f r !,"Enter patient's name: ",str q:str="" d
. s ^XPTNAME(str)=""
f s str=$O(^XPTNAME(str)) q:str="" w !,"A = ",$L(str,"A")
I used $L to hard code each line for each letter or character, but I think that would be labourous. I understand that I will need to use $ASCII and $CHAR. I'm just not sure how to get it accomplished
|Page 1 of 1||All times are UTC - 8 hours [ DST ]|
|Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group