Bill,

Some things to consider:
1. Unless something has changed recently, CHKFILE is documented to be
unreliable with wildcards.
2. You can use the error trapping to determine if there were any file
matches

Set up an error variable at the top of your code.
SET ERROR VAR vErr

Create a pla file with just a carriage return by using the tools called by
CTRL-F1

Then use this code:

  set v vdir=(.vdir+'*.jpg')
  cho vfile fro #lfiles in .vdir
  if vErr = 0 then
    play enter.pla
    update lease set photodef=.vfile whe current of c#1
  endif

-- Dennis McGrath
mailto:[EMAIL PROTECTED]

-- Tools for R:BASE programmers
http://www.enteract.com/~mcgrath/dennis

-- Full time consultant with SQL Resources
mailto:[EMAIL PROTECTED]




-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Bill Eyring
Sent: Wednesday, March 27, 2002 10:41 AM
To: Rbase Mail List (E-mail)
Subject: Playback File


I am trying to get a playback file to automatically select the first
filename in a predefined directory and update a column in a table with that
filename.

The object of this exercise is to set a default file for photos
automatically, without having to manually select a file from a list by
clicking on the filenames from a choose command.

I have been able to get my program to set the directory, but the problem
comes when the playback file does not execute a carriage return and thus not
selecting the first file name from within a directory menu.

Here is my code:

UpdRefNum - sets all variables for the playback file.

cls
cle all variables
set messages off
set error messages off
set v vIdNum int=null
set v vRefNum tex=null
set v vDir tex=null
set v vFile tex=null
set v vplay tex=null
declare c#1 cursor for select idnum,col00011,photodir fro lease+
  order by idnum
open c#1
fetch c#1 into vidnum vi1,vrefnum vi2,vdir vi3
whi sqlcode <> 100 the
  set v vdir=(.vdir+'*.jpg')
  set v vck=(chkfile(.vdir))
  if vck=1 the
    set v vplay tex =('cho vfile fro #lfiles in'&'.vdir'+char(10))
    out jpgplay.pla
    wri .vplay
    out screen
    play jpgplay.pla
    update lease set photodef=.vfile whe current of c#1
  endi
  fetch c#1 into vidnum vi1,vrefnum vi2,vdir vi3
endwhi
drop cursor c#1
ret

I've tried both Char(10) and Char(13) without success.

Any help or comments would be greatly appreciated.



Bill Eyring
Director of Information Systems
Michael Haberman Associates, Inc.
125 Front Street, Mineola, N.Y. 11501
516-739-8080
Rbase Developer

================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/


================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/

Reply via email to