Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Leading 0's problem in data
Message
From
22/05/2015 11:31:37
 
 
To
22/05/2015 05:37:08
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
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:
01620054
Message ID:
01620100
Views:
60
>>I would use an intermediate .controlSource such as a Form.Property, or manage .value myself without .controlSource
>>
>>controlSource = 'thisForm.property'
>>procedure refresh
>>store table.field to (this.controlSource)
>>
>>procedure thisForm.property_assign
>>lparameters propertyValue
>>replace in table field with padl(ltrim(m.propertyValue, '0'), 9)
>>this.property = padl(propertyValue, 9, '0')
>>
>
>And when populating that value from the field, strip the leading zeros
>
>store ltrim(table.field, 1, "0") to (this.controlSource)

We might also want to guard against possible problem of turning an entry of "0" into a blank string.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform