Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting a memory variable with character and numeric
Message
From
22/12/2014 19:24:20
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01612566
Message ID:
01612585
Views:
48
>>I knew there had to be a better way than mine - tnx borislav - great solution.
>>
>>k
>>>>Is there more concise way of converting a memory variable from A15 to A14
>>>>Here's what i have - seems a tad convoluted to me. Maybe i should just be grateful i got it on one line.
>>>>
>>>>n1="A15"
>>>>n2="A"+LTRIM(STR(VAL(SUBSTR(n1,2,2))-1))  &&& gives me n2=A14
>>>>
>>>>tnx
>>>>k
>>>
>>>It is in one line already :-)
>>>
>>>If you need to change only LAST two digits:
>>>
>>>n1="A15"
>>>n2="A"+TRANSFORM(VAL(RIGHT(n1,2))-1)
>>>
>
>Not sure if this will be better :-)
>This is just another way.

It was an awkward puzzle to begin with. I didn't like having to convert into numerical then back into character, your solution is more direct. tnx
Previous
Reply
Map
View

Click here to load this message in the networking platform