Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
8 Bug?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Re: 8 Bug?
Divers
Thread ID:
00754397
Message ID:
00762354
Vues:
18
>Maybe something is initialized to .f. that you are missing and VFP8 is not as forgiving (or as smart?) as previous versions when it comes to implicit typing.
>
>This was giving me fits (for about an hour before I came to the UT to check stuff out).
>
>This gives the error "Not a character expression":
>
>Local ;
>groupName as String , ;
>tableAlias1 as String , ;
>tmpCursor as String
>groupName= 'a45'				
>tableAlias1 = "x"+Sys(2015)			
>outValue = 0
>Use "SecGroup" In 0 Alias ( tableAlias1 ) Again Shared
>Select iiD from (tableAlias1) Where Lower(cGrpName) == Lower(groupName) into Cursor (tmpCursor)
>
>
>This gives the error "Variable 'TMPCURSOR' not found, which is what I think I used to get from VFP6/7 but can't remember at the moment:
>
>*Local ;
>*groupName as String , ;
>*tableAlias1 as String , ;
>*tmpCursor as String
>groupName= 'a45'				
>tableAlias1 = "x"+Sys(2015)			
>outValue = 0
>Use "SecGroup" In 0 Alias ( tableAlias1 ) Again Shared
>Select iiD from (tableAlias1) Where Lower(cGrpName) == Lower(groupName) into Cursor (tmpCursor)
>
You get the error because defining a variable as LOCAL defaults it's value to a logical .F.. That's why your code below works fine, you've created the LOCAL variable tmpCursor, and then assigned it a character value, just as the SQL statement is expecting to find.


>This works fine:
>
>Local ;
>groupName as String , ;
>tableAlias1 as String , ;
>tmpCursor as String
>groupName= 'a45'				
>tableAlias1 = "x"+Sys(2015)			
>tmpCursor = "t"+Sys(2015)			
>outValue = 0
>Use "SecGroup" In 0 Alias ( tableAlias1 ) Again Shared
>Select iiD from (tableAlias1) Where Lower(cGrpName) == Lower(groupName) into Cursor (tmpCursor)
>
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform