Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to retrieve fields marked with system flag?
Message
De
29/08/2002 04:51:35
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
28/08/2002 17:37:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00694690
Message ID:
00694829
Vues:
9
>How do I store or retrive information in fields that are marked with the flags "sys+bin", (0x01 + 0x04) as specified in vfp help:
>
>18 Field Flags::
>0x01 System Column (not visible to user)
>0x02Column can store null values
>0x04Binary column (for CHAR and MEMO only).
>
>If I try to display the contents with the sintax: ? table.field1 I receive the message "Variable 'xxxx' is not found".
>
>Thanks in advance.

Gustavo,
You'd need exclusive access :
*SetRemoveSysFlag
lparameters tcTableName, tnFieldNumber, tlSet
* tcTableName   : table to set-remove system flag
* tnFieldNumber : field number
* tlSet         : If .t. set otherwise (default) remove system flag
local handle, lnsecs
handle = this.OpenFile(fullpath(tcTableName)) && Openfile tries to open
if handle < 0
	return .f.
endif 
=fseek(handle,31+(tnFieldnumber-1)*32+18)
if tlSet
	=fwrite(handle,chr(bitor(val(fread(handle,1)),1)))
else
	=fwrite(handle,chr(bitand(val(fread(handle,1)),254)))
endif
=fclose(handle)
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform