Hi All,
I’m having real dificulty with a script and need help asap.
I have split a text string up which might or might not have spaces in it. Basicaly i have a string like this “13071406 080709” any space will always be 2 characters long. Now I split this string up and display this in text boxes 2 digits to each box, if the user does not amend these digits the same string will be combined and written back. The thing is the characters when I put back together to the original ignores the space so the string looks like this when getting sent back “13071406080709”. What i need is for all characters to be returned to there same position and if the text box is blank or just 1 character long the text box value padded out with a space or spaces.
This is the code i use to split the text
[CODE]xx = dvxGetdavoxfield(‘QBIG1’)
dvxSetuserfield(‘home_buildings_day’,xx.substring(1,3)) ;
dvxSetuserfield(‘hom_buildings_month’,xx.substring(3,5)) ;
dvxSetuserfield(‘home_contents_day’,xx.substring(5,7)) ;
dvxSetuserfield(‘home_contents_month’,xx.substring(7,9)) ;
dvxSetuserfield(‘motor’,xx.substring(9,11)) ;
dvxSetuserfield(‘motormonth’,xx.substring(11,13)) ;
dvxSetuserfield(‘pet’,xx.substring(13,15)) ;
dvxSetuserfield(‘petmonth’,xx.substring(15,17)) ;
dvxSetuserfield(‘travel’,xx.substring(17,19)) ;
dvxSetuserfield(‘travelmonth’,xx.substring(19,21)) ;
;
This is the code i use to piece it back together
[CODE]dvxGetuserfield(‘home_buildings_day’)+
dvxGetuserfield(‘hom_buildings_month’)+
dvxGetuserfield(‘home_contents_day’)+
dvxGetuserfield(‘home_contents_month’)+
dvxGetuserfield(‘motor’)+
dvxGetuserfield(‘motormonth’)+
dvxGetuserfield(‘pet’)+
dvxGetuserfield(‘petmonth’)+
dvxGetuserfield(‘travel’)+
dvxGetuserfield(‘travelmonth’)