|
Home > Archive > Programming with dBASE > October 2005 > Re: dBase on my Network.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: dBase on my Network.
|
|
| Sharlene England 2005-10-20, 8:26 pm |
| > If you need a code example, I can provide you one.
>
Yes, I would appreciate a code examples, thanks.
I'm going to think about this, my only problem is that each user has from
4 - 10 different shortcuts to exe's on his desktop.
So, I would have to build this into every one of my 30 app's.
Thanks again.
| |
| Marc Hamelin 2005-10-20, 8:26 pm |
| >> If you need a code example, I can provide you one.
> Yes, I would appreciate a code examples, thanks.
Okay, see below.
> I'm going to think about this, my only problem is that each user has
> from 4 - 10 different shortcuts to exe's on his desktop.
>
> So, I would have to build this into every one of my 30 app's.
You could create a basic class the does this and simply modify the parts you
need to change.
Here's what I'm currently using:
*************
parameter login, password, compnum
if NOT (upper(left(_app.exeName,3)) == "C:\")
SET SAFETY OFF
fprogres = new Form()
fprogres.mdi = false
fprogres.height = 3
fprogres.width = 54.5
fprogres.autoCenter = true
fprogres.sysMenu = false
fprogres.smallTitle = false
fprogres.sizeable = false
fprogres.moveable = false
fprogres.showTaskBarButton = false
fprogres.text = "Loading program, please wait..."
fprogres.progress1 = new progress(this)
fprogres.progress1.top = 1
fprogres.progress1.height = 1
fprogres.progress1.left = 2
fprogres.progress1.width = 50.5
fprogres.progress1.rangeMin = 0
fprogres.progress1.rangeMax = 34
fprogres.progress1.value = 0
fprogres.open()
fprogres.progress1.value += 1
currentPath = left(program(1),rat(
"\",program(1),1))
listSize = new array()
checkFile = new file()
fprogres.progress1.value += 1
querycomp = new query()
querycomp.sql = "SELECT * FROM '" + currentPath + "Resources\Z_COMP.DBF'"
querycomp.active = true
querycomp.rowset.first()
do while querycomp.rowset.endofset = false
querycomp.rowset.beginEdit()
querycomp.rowset.fields["workpath"].value = currentPath
querycomp.rowset.save()
querycomp.rowset.next()
enddo
fprogres.progress1.value += 1
listSize.resize(11,2)
listSize[1,1] = "Gestionprod.exe"
listSize[1,2] = checkFile.size(currentPath + "Gestionprod.exe")
listSize[2,1] = "Gestionprod.ini"
listSize[2,2] = checkFile.size(currentPath + "Gestionprod.ini")
listSize[3,1] = "Resources\Circle.bmp"
listSize[3,2] = checkFile.size(currentPath + "Resources\Circle.bmp")
listSize[4,1] = "Resources\JobStock.bmp"
listSize[4,2] = checkFile.size(currentPath + "Resources\JobStock.bmp")
listSize[5,1] = "Resources\JobHold.bmp"
listSize[5,2] = checkFile.size(currentPath + "Resources\JobHold.bmp")
listSize[6,1] = "Resources\Logoblack.bmp"
listSize[6,2] = checkFile.size(currentPath + "Resources\Logoblack.bmp")
listSize[7,1] = "Resources\Rasakti.ico"
listSize[7,2] = checkFile.size(currentPath + "Resources\Rasakti.ico")
listSize[8,1] = "Resources\Strucmem.dll"
listSize[8,2] = checkFile.size(currentPath + "Resources\Strucmem.dll")
listSize[9,1] = "Resources\Z_COMP.DBF"
listSize[9,2] = checkFile.size(currentPath + "Resources\Z_COMP.DBF")
listSize[10,1] = "Resources\Z_COMP.DBT"
listSize[10,2] = checkFile.size(currentPath + "Resources\Z_COMP.DBT")
listSize[11,1] = "Resources\Z_COMP.MDX"
listSize[11,2] = checkFile.size(currentPath + "Resources\Z_COMP.MDX")
fprogres.progress1.value += 1
try
CD C:\Gestionprod
catch (exception e)
CD C:\
MD Gestionprod
endtry
fprogres.progress1.value += 1
for i = 1 to 2
try
if checkFile.exists("C:\Gestionprod\" + listSize[i,1]) = false
checkFile.copy(currentPath + listSize[i,1],"C:\Gestionprod\" +
listSize[i,1])
endif
catch (exception e)
endtry
fprogres.progress1.value += 1
next
try
CD C:\Gestionprod\Resou
rces
catch (exception e)
CD C:\Gestionprod
MD Resources
endtry
fprogres.progress1.value += 1
for i = 3 to 11
try
if checkFile.exists("C:\Gestionprod\" + listSize[i,1]) = false
checkFile.copy(currentPath + listSize[i,1],"C:\Gestionprod\" +
listSize[i,1])
endif
catch (exception e)
endtry
fprogres.progress1.value += 1
next
for i = 1 to 11
try
if i = 9 OR i = 10 OR i = 11
checkFile.copy(currentPath + listSize[i,1],"C:\Gestionprod\" +
listSize[i,1])
else
if checkFile.size("C:\Gestionprod\" + listSize[i,1]) <>
listSize[i,2]
checkFile.copy(currentPath + listSize[i,1],"C:\Gestionprod\"
+ listSize[i,1])
endif
endif
catch (exception e)
endtry
fprogres.progress1.value += 1
next
fprogres.progress1.value += 1
if pcount() <= 0
Run(true," C:\Gestionprod\Gesti
onprod.exe")
elseif pcount() = 1
Run(true," C:\Gestionprod\Gesti
onprod.exe " + login)
elseif pcount() = 2
Run(true," C:\Gestionprod\Gesti
onprod.exe " + login + " " + password)
elseif pcount() >= 3
Run(true," C:\Gestionprod\Gesti
onprod.exe " + login + " " + password +
" " + compnum)
endif
fprogres.progress1.value += 1
fprogres.close()
QUIT
endif
*************
Hope this helps.
Marc Hamelin
| |
|
| HI,
I would check the file date as well, as you can change something in the file
without afecting file size
RObert
"Marc Hamelin" <m.hamelin@nospam-rasakti.com> wrote in message
news:dOG9THB1FHA.2248@news-server...
>
> Okay, see below.
>
>
> You could create a basic class the does this and simply modify the parts
you
> need to change.
>
> Here's what I'm currently using:
>
> *************
> parameter login, password, compnum
>
> if NOT (upper(left(_app.exeName,3)) == "C:\")
>
> SET SAFETY OFF
>
> fprogres = new Form()
> fprogres.mdi = false
> fprogres.height = 3
> fprogres.width = 54.5
> fprogres.autoCenter = true
> fprogres.sysMenu = false
> fprogres.smallTitle = false
> fprogres.sizeable = false
> fprogres.moveable = false
> fprogres.showTaskBarButton = false
> fprogres.text = "Loading program, please wait..."
> fprogres.progress1 = new progress(this)
> fprogres.progress1.top = 1
> fprogres.progress1.height = 1
> fprogres.progress1.left = 2
> fprogres.progress1.width = 50.5
> fprogres.progress1.rangeMin = 0
> fprogres.progress1.rangeMax = 34
> fprogres.progress1.value = 0
>
> fprogres.open()
>
> fprogres.progress1.value += 1
>
> currentPath = left(program(1),rat(
"\",program(1),1))
> listSize = new array()
> checkFile = new file()
>
> fprogres.progress1.value += 1
>
> querycomp = new query()
> querycomp.sql = "SELECT * FROM '" + currentPath +
"Resources\Z_COMP.DBF'"
> querycomp.active = true
>
> querycomp.rowset.first()
> do while querycomp.rowset.endofset = false
> querycomp.rowset.beginEdit()
> querycomp.rowset.fields["workpath"].value = currentPath
> querycomp.rowset.save()
> querycomp.rowset.next()
> enddo
>
> fprogres.progress1.value += 1
>
> listSize.resize(11,2)
> listSize[1,1] = "Gestionprod.exe"
> listSize[1,2] = checkFile.size(currentPath + "Gestionprod.exe")
> listSize[2,1] = "Gestionprod.ini"
> listSize[2,2] = checkFile.size(currentPath + "Gestionprod.ini")
> listSize[3,1] = "Resources\Circle.bmp"
> listSize[3,2] = checkFile.size(currentPath + "Resources\Circle.bmp")
> listSize[4,1] = "Resources\JobStock.bmp"
> listSize[4,2] = checkFile.size(currentPath + "Resources\JobStock.bmp")
> listSize[5,1] = "Resources\JobHold.bmp"
> listSize[5,2] = checkFile.size(currentPath + "Resources\JobHold.bmp")
> listSize[6,1] = "Resources\Logoblack.bmp"
> listSize[6,2] = checkFile.size(currentPath + "Resources\Logoblack.bmp")
> listSize[7,1] = "Resources\Rasakti.ico"
> listSize[7,2] = checkFile.size(currentPath + "Resources\Rasakti.ico")
> listSize[8,1] = "Resources\Strucmem.dll"
> listSize[8,2] = checkFile.size(currentPath + "Resources\Strucmem.dll")
> listSize[9,1] = "Resources\Z_COMP.DBF"
> listSize[9,2] = checkFile.size(currentPath + "Resources\Z_COMP.DBF")
> listSize[10,1] = "Resources\Z_COMP.DBT"
> listSize[10,2] = checkFile.size(currentPath + "Resources\Z_COMP.DBT")
> listSize[11,1] = "Resources\Z_COMP.MDX"
> listSize[11,2] = checkFile.size(currentPath + "Resources\Z_COMP.MDX")
> fprogres.progress1.value += 1
>
> try
> CD C:\Gestionprod
> catch (exception e)
> CD C:\
> MD Gestionprod
> endtry
>
> fprogres.progress1.value += 1
>
> for i = 1 to 2
> try
> if checkFile.exists("C:\Gestionprod\" + listSize[i,1]) = false
> checkFile.copy(currentPath + listSize[i,1],"C:\Gestionprod\" +
> listSize[i,1])
> endif
> catch (exception e)
> endtry
> fprogres.progress1.value += 1
> next
>
> try
> CD C:\Gestionprod\Resou
rces
> catch (exception e)
> CD C:\Gestionprod
> MD Resources
> endtry
>
> fprogres.progress1.value += 1
> for i = 3 to 11
> try
> if checkFile.exists("C:\Gestionprod\" + listSize[i,1]) = false
> checkFile.copy(currentPath + listSize[i,1],"C:\Gestionprod\" +
> listSize[i,1])
> endif
> catch (exception e)
> endtry
> fprogres.progress1.value += 1
> next
>
> for i = 1 to 11
> try
> if i = 9 OR i = 10 OR i = 11
> checkFile.copy(currentPath + listSize[i,1],"C:\Gestionprod\" +
> listSize[i,1])
> else
> if checkFile.size("C:\Gestionprod\" + listSize[i,1]) <>
> listSize[i,2]
> checkFile.copy(currentPath +
listSize[i,1],"C:\Gestionprod\"
> + listSize[i,1])
> endif
> endif
> catch (exception e)
> endtry
> fprogres.progress1.value += 1
> next
>
> fprogres.progress1.value += 1
>
> if pcount() <= 0
> Run(true," C:\Gestionprod\Gesti
onprod.exe")
> elseif pcount() = 1
> Run(true," C:\Gestionprod\Gesti
onprod.exe " + login)
> elseif pcount() = 2
> Run(true," C:\Gestionprod\Gesti
onprod.exe " + login + " " + password)
> elseif pcount() >= 3
> Run(true," C:\Gestionprod\Gesti
onprod.exe " + login + " " + password
+
> " " + compnum)
> endif
>
> fprogres.progress1.value += 1
> fprogres.close()
>
> QUIT
>
> endif
> *************
>
> Hope this helps.
>
> Marc Hamelin
>
>
| |
| Marc Hamelin 2005-10-20, 8:26 pm |
| > I would check the file date as well, as you can change something in
> the file without afecting file size
Yeah, I had another version of this code that did that, but it is a bit
slower and since, at least in my case, recompiling an .exe in dBase always
result in a file with a different size, I decided to use this one instead.
Marc Hamelin
|
|
|
|
|