Funny Behaving Locate - don't know where's the problem

Funny Behaving Locate - don't know where's the problem

Post by Razoru » Tue, 12 Mar 2002 18:42:45



I would like to ask for hints connected with following problem.

The part of code listed below searches for filepath in the table.
Type of  field SrcFile is Memo, field Backup_Id is Integer.
Variable tcFileName has type Character, and iCurrentBackupId is declared
as Integer.
Search is made on unindexed table opened in default datasession as shared.

Lparameters tcFileName

If Vartype(tcFileName) # "C"
 Return .F.
Endif

Local llSuccess, lcFileName

Select t_ExFile

lcFileName = Alltrim(tcFileName)
Locate For t_ExFile.SrcFile = Alltrim(tcFileName) And ;
       t_ExFile.backup_id = This.iCurrentBackupId
llSuccess = Found()

Select t_File

Return llSuccess

The problem is, that the method works properly, when running  in FoxPro environment, as a part of an applicaton. After compiling the application into *.exe, Locate finds nothing.

 
 
 

Funny Behaving Locate - don't know where's the problem

Post by Lew Schwart » Tue, 12 Mar 2002 23:32:24


Is it possible that set exact is ON in the .exe?
-Lew

I would like to ask for hints connected with following problem.

The part of code listed below searches for filepath in the table.
Type of  field SrcFile is Memo, field Backup_Id is Integer.
Variable tcFileName has type Character, and iCurrentBackupId is declared
as Integer.
Search is made on unindexed table opened in default datasession as shared.

Lparameters tcFileName

If Vartype(tcFileName) # "C"
 Return .F.
Endif

Local llSuccess, lcFileName

Select t_ExFile

lcFileName = Alltrim(tcFileName)
Locate For t_ExFile.SrcFile = Alltrim(tcFileName) And ;
       t_ExFile.backup_id = This.iCurrentBackupId
llSuccess = Found()

Select t_File

Return llSuccess

The problem is, that the method works properly, when running  in FoxPro
environment, as a part of an applicaton. After compiling the application
into *.exe, Locate finds nothing.

 
 
 

Funny Behaving Locate - don't know where's the problem

Post by Razoru » Wed, 13 Mar 2002 16:34:33




Quote:> Is it possible that set exact is ON in the .exe?
> -Lew

The values we're serching for are not unique, so in that case SET EXACT
should be ON

To answer other enviroment questions, here's fragment with envinroment
settings:

If Not Empty(This.cStartupMenu)
    Push Menu _Msysmenu
Endif
lcTemp = This.cReference  + ".OnShutdown()"
On Shutdown &lcTemp
lcTemp = This.cReference + ".Error(ERROR(),PROGRAM(),LINENO())"
On Error &lcTemp
If Vartype(This.cMacKey) = "C"
 lcTemp = This.cMacKey
 Set Mackey To &lcTemp
Else
 Set Mackey To
Endif
Clear Macros
Set Safety           Off
Set Memowidth To 120
Set Multilocks     On               && For table buffering
Set Deleted         On
Set Exclusive       Off
Set Notify            Off
Set Near              Off
Set Exact              On
Set Confirm          On
*-Set Compatible Off
*-Set Resource    Off
With This
    _Screen.BackColor = 12632256
    _Screen.Caption = .cCaption
     If !.lDebugMode
          Set Escape Off
     Else
          Set Escape On
     Endif
Endwith

I would be happy to see more ideas connected with my topic.

Thanks anyway

                        Razorus