lifesupport
Programmer
Currently this app is a single user app and I've been asked to make it a multi-user app to be networked.
The app I working on is not a typical save and alter data type of application. It consists of several very small tables which save selections by the user from data prepared by a marketing research firm; therefore, I more or less have to keep the same format of this inherited code since files come from different sources. These selections are temporary and are used to produce a report, then they are no longer needed. The entire app uses many complex select statements so if I can avoid an even more complex naming scheme, it would be better. If two users are running the same report, they will both be using the same small selection files, thus producing a 'file in use error'. My solution is as follows but will get pretty 'harry' upon usage of field names as you can see. Is there a better way?
RELEASE pcext
PUBLIC pcext
pcext=SYS(2015)
COPY file filename.dbf TO ("filename"+ALLTRIM(pcext)+".dbf")
IF NOT used ("filename"+ALLTRIM(pcext))
USE ("filename"+ALLTRIM(pcext)) IN 0
Endif
SELECT ("filename"+ALLTRIM(pcext))
Go top
defdir=EVALUATE(("filename"+ALLTRIM(pcext)+".fieldname"))
Thanks
The app I working on is not a typical save and alter data type of application. It consists of several very small tables which save selections by the user from data prepared by a marketing research firm; therefore, I more or less have to keep the same format of this inherited code since files come from different sources. These selections are temporary and are used to produce a report, then they are no longer needed. The entire app uses many complex select statements so if I can avoid an even more complex naming scheme, it would be better. If two users are running the same report, they will both be using the same small selection files, thus producing a 'file in use error'. My solution is as follows but will get pretty 'harry' upon usage of field names as you can see. Is there a better way?
RELEASE pcext
PUBLIC pcext
pcext=SYS(2015)
COPY file filename.dbf TO ("filename"+ALLTRIM(pcext)+".dbf")
IF NOT used ("filename"+ALLTRIM(pcext))
USE ("filename"+ALLTRIM(pcext)) IN 0
Endif
SELECT ("filename"+ALLTRIM(pcext))
Go top
defdir=EVALUATE(("filename"+ALLTRIM(pcext)+".fieldname"))
Thanks