Lou Lesko <loulesko DeleteThis @yahoo.com> wrote:
> Share the details, that's the idea behind a newsgroup.
OK. It seemed me there was no interest about the thing...
Even it's not the perfect way, I did so:
I made a calculation field in the first table of the file to import
(I'll call it 'origin'), with no memorized path of the file (calculated
as needed). This should really be done before to all files that can have
the need to be imported somewhere (now I will do it, even I don't know
if I will use it).
After that, in the new file, I made a script with a first import of the
path from the origin file to a global field; then I assigned the path to
a variable, and used this variable as path to import all tables from the
origin (one import step for each tabale). So, if the origin has the
field I called 'fileptah' I must select only one time the origin,
otherwise, I'll be asked to select it for any table my script want's to
import.
Not clear? OK, here's the script:
Freeze Window
Beep
Beep
Beep
Show Custom Dialog [ Title: "ATTENZIONE:"; Message: "L'importazione
eliminerà tutti i dati attualmente presenti nel ï¬le, si è
sicuri di voler procedere?"; Buttons: "Annulla", "Procedi" ]
Enter Browse Mode
If [ Get ( LastMessageChoice ) = 2 ]
# Path Import
Set Variable [ $vecchioï¬le; Value:"dati da importare" ]
Import Records [ Source: "$vecchioï¬le"; Target: "PraticaEdile";
Method: Add; Character Set: "Mac Roman"; Field Mapping:
Source ï¬eld 124 import to PraticaEdile::import_path ]
[ No dialog ]
If [ PraticaEdile::import_path = "" ]
Beep
Show Custom Dialog [ Title: "Importazione vecchi Modul-EDI";
Message: "Il ï¬le indicato è di una versione precedente
alla 2.6, e non è possibile stabilirne la versione e la posizione
per tutte le operazioni necessarie; pertanto sarà
necessario selezionarlo più volte per il completamento
dell'importazione. E' comunque sconsigliato l'importazione di
dati da versioni precedenti alla 2.5"; Buttons: "OK", "Annulla" ]
If [ Get ( LastMessageChoice ) = 2 ]
Exit Script [ ]
End If
Else
Set Variable [ $vecchioï¬le; Value:PraticaEdile::import_path ]
End If
# File Reset
Go to Layout [ "Tecnici e imprese" (Tecnici e imprese) ]
Show All Records
Delete All Records [ No dialog ]
Go to Layout [ "Elenco Asseverazioni" (Asseverazione) ]
Show All Records
Delete All Records [ No dialog ]
Go to Layout [ "Elenco Domande" (Domanda univoca) ]
Show All Records
Delete All Records [ No dialog ]
Go to Layout [ "Scheda Privato" (PraticaEdile) ]
Show All Records
Delete All Records [ No dialog ]
# Data Import
Import Records [ Source: "$vecchioï¬le"; Target: "PraticaEdile";
Method: Add; Character Set: "Mac Roman"; Field Mapping:
\cut
[ No dialog ]
Go to Layout [ "Elenco Domande" (Domanda univoca) ]
Import Records [ Source: "$vecchioï¬le"; Target: "Domanda univoca";
Method: Add; Character Set: "Mac Roman"; Field Mapping:
\cut
[ No dialog ]
Go to Layout [ "Elenco Asseverazioni" (Asseverazione) ]
Import Records [ Source: "$vecchioï¬le"; Target: "Asseverazione";
Method: Add; Character Set: "Mac Roman"; Field Mapping:
\cut
[ No dialog ]
Go to Layout [ "Tecnici e imprese" (Tecnici e imprese) ]
Import Records [ Source: "$vecchioï¬le"; Target: "Tecnici e imprese";
Method: Add; Character Set: "Mac Roman"; Field
Mapping:
\cut
[ No dialog ]
Go to Layout [ "Scheda Privato" (PraticaEdile) ]
End If
Refresh Window
I repeat, it's not perfect way, so If someone has a better one (to
import multiple table of 'before unknown path files') I'm happy to here
this other methods.
P.S. excuse me for me no perfect english

--
Per rispondere, togliere -NOSPAM- dall'indirizzo.
>> Stay informed about: Path name to variable