Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Padded strings
Message
From
04/01/2002 10:07:46
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00600660
Message ID:
00600755
Views:
23
>< snip >>
>>Paul,
>>Are you sure ? VFP doesn't pad unless told to do. Even if it were padded :
>>if thisform.myprop = "test"
>>would return .t. whether set exact ON/OFF.
>
>Hi Cetin,
>
>It would return .f. if thisform.myprop is padded with spaces and set exact is ON.
>
>>
>< snip >

Sergey,
I think you made a typo. If SET exact were OFF and right side was padded with spaces it would return .F.
Set exact ON setting ensures it'd return .T. whatever side was padded with spaces (exception is SQL where set ansi needed).
oTest = createobject('myObject')
ShowResult(oTest,'ON')
ShowResult(oTest,'OFF')

function ShowResult
lparameters toObject, tcXactState
set exact &tcXactState
with toObject
? 'Set exact is '+set('exact')
? '****************************'
? 'myProp1', ;
  .myProp1 = 'test', ;
  .myProp1 = 'test    ', ;
  .myProp1 = 'test'+space(50), ;
  .myProp1 = padr('test',500)
  
? 'myProp2', ;
  .myProp2 = 'test', ;
  .myProp2 = 'test    ', ;
  .myProp2 = 'test'+space(50), ;
  .myProp2 = padr('test',500)

? 'myProp3', ;
  .myProp3 = 'test', ;
  .myProp3 = 'test    ', ;
  .myProp3 = 'test'+space(50), ;
  .myProp3 = padr('test',500)

? 'myProp4', ;
  .myProp4 = 'test', ;
  .myProp4 = 'test    ', ;
  .myProp4 = 'test'+space(50), ;
  .myProp4 = padr('test',500)
? '****************************'
endwith

define class myObject as Relation
 myprop1 = 'test'
 myprop2 = 'test       '
 myprop3 = 'test'+space(100)
 myprop4 = padr('test',100)
enddefine
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform