Hi,
I've searched this forum looking for similar code to mine and trying to amend what I have found to suit me, but for a novice code writer I'm struggling to achieve what I need. But I apologise if this is a bit basic.
I'm trying to select the first name of a full name.
So I need the Dolph in 'Mr Dolph Lundgren'.
At the moment all I've achieved is removing the 'Mr'
--------------
define(&datastr, string, '')
define(&i, integer, 1)
define(&curstr, string, '')
&datastr := @(3,1,30)
repeat
&i := &i + 1
until((mid(&datastr, &i, 1) = ' ') or (&i >= 30))
&i := &i + 1
&curstr := mid(&datastr, &i, 30)
show(trim(&curstr))
&GlobalVariable9 := &curstr
--------------
In the long run, I'm going to need an if statement where if the first name is just an initial, use the entire string, but god help me, my head would explode if I tried that at the moment.
Any help would be greatly appreciated. Except the kind that directs me towards the tutorial.....