Date   

Re: Magic Batch Files

buster reinke
 

Thanks Keith, this should help with what I am trying to do.

Regards,

Buster




On Thursday, April 7, 2022, 7:27 pm, Keith Canniff <kcanniff@...> wrote:

Buster,

 

Go into Magic’s Help and type in “fileinfo”. You will get the following

 

Note: At the bottom of this function (and almost every function in Magic) there is a reference to a program that’s provide with Magic in their sample applications that uses the function in an actual program. So not only do you have the definition below, you can lookup how it’s actually used in a program.

FileInfo

Returns the file properties.

Syntax:

FileInfo (name, info type)

Parameters:

name: A file (with or without a path) or a directory.

If no path or a relative path is specified, it will be relative to the project folder.

info type: The file information will be according to the following table:

Info Type Value

Description

1

File name (without path)

2

Location (file path)

3

Full path (Location + File name)

4

Attributes – comma-delimited string that contains the following attributes (additional info exists at msdn):

  • ARCHIVE
  • COMPRESSED
  • DIRECTORY
  • ENCRYPTED
  • HIDDEN
  • READONLY
  • SYSTEM

Note: These strings will be in English even when using the mgconsts of other languages.

5

Size in bytes (without thousand separator)

6

Created date

7

Created time

8

Modified date

9

Modified time

10

Accessed date

11

Accessed time

 

Returns:

The file properties.

The function will return the appropriate information according to the Info Type.

In case of an error (file does not exist), the function will return Null.

Note:

If the path ends with a backslash (\), the function may return blank. It is recommended not to include the backslash at the end of the path.

Platform specific:

For the UNIX operating system, the Created and Accessed date and time will be equal to the Modified date and time.

See also:

ClientFileInfo

How Do I Get the Size of a File on Disk?

How Do I Get the Creation Date of a File on Disk?

The Online and Rich Client Samples projects (program EL15, EL16, EL17, EL20, EL21 REL15, REL16, REL17, REL20 and REL21)

 

Keith

 

From: main@magicu-l.groups.io <main@magicu-l.groups.io> On Behalf Of buster reinke via groups.io
Sent: Thursday, April 7, 2022 1:10 AM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Magic Batch Files

 

Thanks Tim, but I don't understand what that means. If someone could help me with an expression that is able to check the date of a file, that would be great.

Regards,

Buster

On Thursday, 7 April 2022, 02:59:15 pm AEST, Tim Downie <tim_downie@...> wrote:

 

 

Off the top of my head there is a fu crion fileinfo or somthing like this...you pass it a file name and the attribute you want


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of buster reinke via groups.io <buster_png@...>
Sent: Thursday, 7 April 2022 2:13 PM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: Re: [magicu-l] Magic Batch Files

 

Hi all, I have another question regarding Batch Files. I have created another OS Com line that will allow the user to restore the system to the start of the day, by going to the sqlite.SQLite backup file that is created at the beginning of each day and copying it over the current sqlite.SQLite file. This file is overwritten each day to ensure that the restore will not go back any further than today. Is there an easy way to create an expression that gets Magic to first check the date of the file it is about to copy for the restore process to ensure that it is dated today? (I want to put this in as a safety device in the event that for some reason, the daily backup hasn't taken place. I don't want the user to revert back to an old backup any earlier than the beginning of the day) If the date is not todays date, then I want Magic to ignore the copy command.

If anyone is able to help, could you please give me an example of the expression I should use?

Thanks,

Buster

On Thursday, 31 March 2022, 10:26:48 pm AEST, Keith Canniff <kcanniff@...> wrote:

 

 

This is more of a Magic 101 response. How to insulate your application as much as possible from the outside world.

 

As a suggestion, anytime you’re working with external processes, it’s best to wrap them in a magic program. What I mean is that in your example below, the external OS command would be in a standalone program (or could be a Magic function) that receives the parameters that are then inserted into the OS command.

 

This has several advantages

 

  1. Only one program has to have the OS command logic in it so its syntax, etc. can be unit tested and you never have to worry about it again.
  2. Every other program in the application can call this program/function and send it normal parameters.
  3. If you ever decide to change the contents of the program/function (use C# snippet, Merge, cmd, whatever), only one program has to be changed and the rest of the application doesn’t care. It still calls the same program/function unchanged.

 

Keith Canniff

 

From: main@magicu-l.groups.io <main@magicu-l.groups.io>On Behalf Of Jeroen Bos via groups.io
Sent: Thursday, March 31, 2022 4:00 AM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Magic Batch Files

 

Instead of using merge, it is also possible to do it with an export to file with a cmd (Windows) or sh (Linux/Unix) extension and afterwards call the just exported file . The only thing you shouldn’t forget is when your on Linux/Unix, is to set the execution bit after exporting….

 

Met vriendelijke groet / Yours sincerely

De bronafbeelding bekijken

 

 


Jeroen Bos | Technisch Consultant (Technical Consultant)

Lekkerland Nederland B.V. | Ekkersrijt 7601 | 5692 HR Son

+31 (0) 40 264 4400 

jeroen.bos@...

www.lekkerland.nl | www.lekkerland24.nl

De bronafbeelding bekijken

 


Volg ons op              

 

 

Van:main@magicu-l.groups.io <main@magicu-l.groups.io>Namens Micha Weiss via groups.io
Verzonden: donderdag 31 maart 2022 07:59
Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] Magic Batch Files

 

When it comes to complex building dynamically on the fly scripts, using MERGE is  a good option as well.

We are using  MERGE to build ftp scripts dynamically. Here is Example for such template

Micha

HUJI

 

open <!$MG_Server>

<!$MG_User>

<!$MG_Password>

 

<!$MGIF_AsciiTransfer>ascii<!$MGENDIF>

<!$MGIF_BinaryTRansfer>binary<!$MGENDIF>

 

prompt

 

cd <!$MG_RemoteDir>

 

<!$MGIF_GetFile>

 

lcd "<!$MG_LocalFilePath>"

 

mget "<!$MG_RemoteFileMaskName>"

 

<!$MGIF_DeleteFileAtServer>mdel <!$MG_RemoteFileMaskName><!$MGIF_AllVersionsAtServer>;*<!$MGENDIF><!$MGENDIF>

 

<!$MGENDIF>

 

<!$MGIF_PutFile>

 

mput "<!$MG_LocalFilePathAndMaskName>"

 

<!$MGENDIF>

 

close

bye

 

 

 

 

 

From:main@magicu-l.groups.io <main@magicu-l.groups.io>On Behalf Ofbuster reinke via groups.io
Sent:Monday, March 28, 2022 7:10 AM
To:main@magicu-l.groups.io
Subject:Re: [magicu-l] Magic Batch Files

 

Thanks Keith, I went with Roberto’s method as I prefer to use internal Magic stuff when I can. It works very well, and now I don’t need to bother with the batch files.

 

Buster

On Monday, March 28, 2022, 2:06 pm, Keith Canniff <kcanniff@...> wrote:

Buster

 

You can easily pass parameters to a batch file

 

 


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of buster reinke via groups.io <buster_png@...>
Sent: Sunday, March 27, 2022 6:46:56 PM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: Re: [magicu-l] Magic Batch Files

 

Perfect, thanks Roberto, this is exactly what I was looking for.

 

Regards,

 

Buster

 

On Monday, 28 March 2022, 08:43:54 am AEST, Roberto Ramirez Cervantes <marionette_66@...> wrote:

 

 

For example, create an expression like this:

'cmd \c xcopy '&trim(A)&trim(B)&' '&Trim(C)

where

A = Source Path (with \ at the end)
B = File types to copy (*.txt)
C = Destination Path  (with \ at the end)

Use this expression with the "Invoke OS Command" operation, set the wait parameter to "Yes"

Roberto

-------------------------------------------------------------------------------------------------
This e-mail may contain confidential and/or privileged information. If you are not the
intended receipient (or have received this e-mail in error) please notify the sender
immediately and destroy this e-mail.
Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly
forbidden.

Deze e-mail kan vertrouwelijke en/of persoonlijke informatie bevatten. Als u niet de bedoelde
ontvanger bent, of deze e-mail per ongeluk heeft gekregen, breng dan de verzender
ogenblikkelijk hiervan op de hoogte en vernietig dit bericht.
Het kopieren, in de openbaarheid brengen of verspreiden van de inhoud van deze e-mail is ten
strengste verboden.

Ce courriel peut contenir des informations confidentielles et/ou privilegiees. Si ce courriel ne vous est pas destine
(ou vous avez recu ce courriel par erreur) svp, avertissez immediatement la personne qui a envoye ce courriel et detruisez le.
Toute copie non autorisee, divulgation des informations ou distribution du contenu de ce courriel sont strictement interdites.
-------------------------------------------------------------------------------------------------


Re: Magic Batch Files

Keith Canniff
 

Buster,

 

Go into Magic’s Help and type in “fileinfo”. You will get the following

 

Note: At the bottom of this function (and almost every function in Magic) there is a reference to a program that’s provide with Magic in their sample applications that uses the function in an actual program. So not only do you have the definition below, you can lookup how it’s actually used in a program.

FileInfo

Returns the file properties.

Syntax:

FileInfo (name, info type)

Parameters:

name: A file (with or without a path) or a directory.

If no path or a relative path is specified, it will be relative to the project folder.

info type: The file information will be according to the following table:

Info Type Value

Description

1

File name (without path)

2

Location (file path)

3

Full path (Location + File name)

4

Attributes – comma-delimited string that contains the following attributes (additional info exists at msdn):

  • ARCHIVE
  • COMPRESSED
  • DIRECTORY
  • ENCRYPTED
  • HIDDEN
  • READONLY
  • SYSTEM

Note: These strings will be in English even when using the mgconsts of other languages.

5

Size in bytes (without thousand separator)

6

Created date

7

Created time

8

Modified date

9

Modified time

10

Accessed date

11

Accessed time

 

Returns:

The file properties.

The function will return the appropriate information according to the Info Type.

In case of an error (file does not exist), the function will return Null.

Note:

If the path ends with a backslash (\), the function may return blank. It is recommended not to include the backslash at the end of the path.

Platform specific:

For the UNIX operating system, the Created and Accessed date and time will be equal to the Modified date and time.

See also:

ClientFileInfo

How Do I Get the Size of a File on Disk?

How Do I Get the Creation Date of a File on Disk?

The Online and Rich Client Samples projects (program EL15, EL16, EL17, EL20, EL21 REL15, REL16, REL17, REL20 and REL21)

 

Keith

 

From: main@magicu-l.groups.io <main@magicu-l.groups.io> On Behalf Of buster reinke via groups.io
Sent: Thursday, April 7, 2022 1:10 AM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Magic Batch Files

 

Thanks Tim, but I don't understand what that means. If someone could help me with an expression that is able to check the date of a file, that would be great.

Regards,

Buster

On Thursday, 7 April 2022, 02:59:15 pm AEST, Tim Downie <tim_downie@...> wrote:

 

 

Off the top of my head there is a fu crion fileinfo or somthing like this...you pass it a file name and the attribute you want


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of buster reinke via groups.io <buster_png@...>
Sent: Thursday, 7 April 2022 2:13 PM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: Re: [magicu-l] Magic Batch Files

 

Hi all, I have another question regarding Batch Files. I have created another OS Com line that will allow the user to restore the system to the start of the day, by going to the sqlite.SQLite backup file that is created at the beginning of each day and copying it over the current sqlite.SQLite file. This file is overwritten each day to ensure that the restore will not go back any further than today. Is there an easy way to create an expression that gets Magic to first check the date of the file it is about to copy for the restore process to ensure that it is dated today? (I want to put this in as a safety device in the event that for some reason, the daily backup hasn't taken place. I don't want the user to revert back to an old backup any earlier than the beginning of the day) If the date is not todays date, then I want Magic to ignore the copy command.

If anyone is able to help, could you please give me an example of the expression I should use?

Thanks,

Buster

On Thursday, 31 March 2022, 10:26:48 pm AEST, Keith Canniff <kcanniff@...> wrote:

 

 

This is more of a Magic 101 response. How to insulate your application as much as possible from the outside world.

 

As a suggestion, anytime you’re working with external processes, it’s best to wrap them in a magic program. What I mean is that in your example below, the external OS command would be in a standalone program (or could be a Magic function) that receives the parameters that are then inserted into the OS command.

 

This has several advantages

 

  1. Only one program has to have the OS command logic in it so its syntax, etc. can be unit tested and you never have to worry about it again.
  2. Every other program in the application can call this program/function and send it normal parameters.
  3. If you ever decide to change the contents of the program/function (use C# snippet, Merge, cmd, whatever), only one program has to be changed and the rest of the application doesn’t care. It still calls the same program/function unchanged.

 

Keith Canniff

 

From: main@magicu-l.groups.io <main@magicu-l.groups.io>On Behalf Of Jeroen Bos via groups.io
Sent: Thursday, March 31, 2022 4:00 AM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Magic Batch Files

 

Instead of using merge, it is also possible to do it with an export to file with a cmd (Windows) or sh (Linux/Unix) extension and afterwards call the just exported file . The only thing you shouldn’t forget is when your on Linux/Unix, is to set the execution bit after exporting….

 

Met vriendelijke groet / Yours sincerely

De bronafbeelding bekijken

 

 


Jeroen Bos | Technisch Consultant (Technical Consultant)

Lekkerland Nederland B.V. | Ekkersrijt 7601 | 5692 HR Son

+31 (0) 40 264 4400 

jeroen.bos@...

www.lekkerland.nl | www.lekkerland24.nl

De bronafbeelding bekijken

 


Volg ons op              

 

 

Van:main@magicu-l.groups.io <main@magicu-l.groups.io>Namens Micha Weiss via groups.io
Verzonden: donderdag 31 maart 2022 07:59
Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] Magic Batch Files

 

When it comes to complex building dynamically on the fly scripts, using MERGE is  a good option as well.

We are using  MERGE to build ftp scripts dynamically. Here is Example for such template

Micha

HUJI

 

open <!$MG_Server>

<!$MG_User>

<!$MG_Password>

 

<!$MGIF_AsciiTransfer>ascii<!$MGENDIF>

<!$MGIF_BinaryTRansfer>binary<!$MGENDIF>

 

prompt

 

cd <!$MG_RemoteDir>

 

<!$MGIF_GetFile>

 

lcd "<!$MG_LocalFilePath>"

 

mget "<!$MG_RemoteFileMaskName>"

 

<!$MGIF_DeleteFileAtServer>mdel <!$MG_RemoteFileMaskName><!$MGIF_AllVersionsAtServer>;*<!$MGENDIF><!$MGENDIF>

 

<!$MGENDIF>

 

<!$MGIF_PutFile>

 

mput "<!$MG_LocalFilePathAndMaskName>"

 

<!$MGENDIF>

 

close

bye

 

 

 

 

 

From:main@magicu-l.groups.io <main@magicu-l.groups.io>On Behalf Ofbuster reinke via groups.io
Sent:Monday, March 28, 2022 7:10 AM
To:main@magicu-l.groups.io
Subject:Re: [magicu-l] Magic Batch Files

 

Thanks Keith, I went with Roberto’s method as I prefer to use internal Magic stuff when I can. It works very well, and now I don’t need to bother with the batch files.

 

Buster

On Monday, March 28, 2022, 2:06 pm, Keith Canniff <kcanniff@...> wrote:

Buster

 

You can easily pass parameters to a batch file

 

 


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of buster reinke via groups.io <buster_png@...>
Sent: Sunday, March 27, 2022 6:46:56 PM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: Re: [magicu-l] Magic Batch Files

 

Perfect, thanks Roberto, this is exactly what I was looking for.

 

Regards,

 

Buster

 

On Monday, 28 March 2022, 08:43:54 am AEST, Roberto Ramirez Cervantes <marionette_66@...> wrote:

 

 

For example, create an expression like this:

'cmd \c xcopy '&trim(A)&trim(B)&' '&Trim(C)

where

A = Source Path (with \ at the end)
B = File types to copy (*.txt)
C = Destination Path  (with \ at the end)

Use this expression with the "Invoke OS Command" operation, set the wait parameter to "Yes"

Roberto

-------------------------------------------------------------------------------------------------
This e-mail may contain confidential and/or privileged information. If you are not the
intended receipient (or have received this e-mail in error) please notify the sender
immediately and destroy this e-mail.
Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly
forbidden.

Deze e-mail kan vertrouwelijke en/of persoonlijke informatie bevatten. Als u niet de bedoelde
ontvanger bent, of deze e-mail per ongeluk heeft gekregen, breng dan de verzender
ogenblikkelijk hiervan op de hoogte en vernietig dit bericht.
Het kopieren, in de openbaarheid brengen of verspreiden van de inhoud van deze e-mail is ten
strengste verboden.

Ce courriel peut contenir des informations confidentielles et/ou privilegiees. Si ce courriel ne vous est pas destine
(ou vous avez recu ce courriel par erreur) svp, avertissez immediatement la personne qui a envoye ce courriel et detruisez le.
Toute copie non autorisee, divulgation des informations ou distribution du contenu de ce courriel sont strictement interdites.
-------------------------------------------------------------------------------------------------


Has anyone successfully used the new JSON Datatype in xpa 4.8? #xpa

Friedrich Geisler-Buckert
 

hi all,

yesterday i tried to uses the new JSON Datatype from xpa 4.8 - but i failed.

The example in the documentation is full of errors. Doing it in the same way like XML dosn't work.

Best regards
Friedrich  


Re: Magic Batch Files

buster reinke
 

Thanks Tim, but I don't understand what that means. If someone could help me with an expression that is able to check the date of a file, that would be great.

Regards,

Buster

On Thursday, 7 April 2022, 02:59:15 pm AEST, Tim Downie <tim_downie@...> wrote:


Off the top of my head there is a fu crion fileinfo or somthing like this...you pass it a file name and the attribute you want
From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of buster reinke via groups.io <buster_png@...>
Sent: Thursday, 7 April 2022 2:13 PM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: Re: [magicu-l] Magic Batch Files
 
Hi all, I have another question regarding Batch Files. I have created another OS Com line that will allow the user to restore the system to the start of the day, by going to the sqlite.SQLite backup file that is created at the beginning of each day and copying it over the current sqlite.SQLite file. This file is overwritten each day to ensure that the restore will not go back any further than today. Is there an easy way to create an expression that gets Magic to first check the date of the file it is about to copy for the restore process to ensure that it is dated today? (I want to put this in as a safety device in the event that for some reason, the daily backup hasn't taken place. I don't want the user to revert back to an old backup any earlier than the beginning of the day) If the date is not todays date, then I want Magic to ignore the copy command.

If anyone is able to help, could you please give me an example of the expression I should use?

Thanks,

Buster
On Thursday, 31 March 2022, 10:26:48 pm AEST, Keith Canniff <kcanniff@...> wrote:


This is more of a Magic 101 response. How to insulate your application as much as possible from the outside world.

 

As a suggestion, anytime you’re working with external processes, it’s best to wrap them in a magic program. What I mean is that in your example below, the external OS command would be in a standalone program (or could be a Magic function) that receives the parameters that are then inserted into the OS command.

 

This has several advantages

 

  1. Only one program has to have the OS command logic in it so its syntax, etc. can be unit tested and you never have to worry about it again.
  2. Every other program in the application can call this program/function and send it normal parameters.
  3. If you ever decide to change the contents of the program/function (use C# snippet, Merge, cmd, whatever), only one program has to be changed and the rest of the application doesn’t care. It still calls the same program/function unchanged.

 

Keith Canniff

 

From: main@magicu-l.groups.io <main@magicu-l.groups.io>On Behalf Of Jeroen Bos via groups.io
Sent: Thursday, March 31, 2022 4:00 AM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Magic Batch Files

 

Instead of using merge, it is also possible to do it with an export to file with a cmd (Windows) or sh (Linux/Unix) extension and afterwards call the just exported file . The only thing you shouldn’t forget is when your on Linux/Unix, is to set the execution bit after exporting….

 

Met vriendelijke groet / Yours sincerely

De bronafbeelding bekijken
 

 


Jeroen Bos | Technisch Consultant (Technical Consultant)

Lekkerland Nederland B.V. | Ekkersrijt 7601 | 5692 HR Son

+31 (0) 40 264 4400 

jeroen.bos@...

www.lekkerland.nl | www.lekkerland24.nl

De bronafbeelding bekijken
 


Volg ons op              

 

 

Van:main@magicu-l.groups.io <main@magicu-l.groups.io>Namens Micha Weiss via groups.io
Verzonden: donderdag 31 maart 2022 07:59
Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] Magic Batch Files

 

When it comes to complex building dynamically on the fly scripts, using MERGE is  a good option as well.

We are using  MERGE to build ftp scripts dynamically. Here is Example for such template

Micha

HUJI

 

open <!$MG_Server>

<!$MG_User>

<!$MG_Password>

 

<!$MGIF_AsciiTransfer>ascii<!$MGENDIF>

<!$MGIF_BinaryTRansfer>binary<!$MGENDIF>

 

prompt

 

cd <!$MG_RemoteDir>

 

<!$MGIF_GetFile>

 

lcd "<!$MG_LocalFilePath>"

 

mget "<!$MG_RemoteFileMaskName>"

 

<!$MGIF_DeleteFileAtServer>mdel <!$MG_RemoteFileMaskName><!$MGIF_AllVersionsAtServer>;*<!$MGENDIF><!$MGENDIF>

 

<!$MGENDIF>

 

<!$MGIF_PutFile>

 

mput "<!$MG_LocalFilePathAndMaskName>"

 

<!$MGENDIF>

 

close

bye

 

 

 

 

 

From:main@magicu-l.groups.io <main@magicu-l.groups.io>On Behalf Ofbuster reinke via groups.io
Sent:Monday, March 28, 2022 7:10 AM
To:main@magicu-l.groups.io
Subject:Re: [magicu-l] Magic Batch Files

 

Thanks Keith, I went with Roberto’s method as I prefer to use internal Magic stuff when I can. It works very well, and now I don’t need to bother with the batch files.

 

Buster

On Monday, March 28, 2022, 2:06 pm, Keith Canniff <kcanniff@...> wrote:

Buster

 

You can easily pass parameters to a batch file

 

 


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of buster reinke via groups.io <buster_png@...>
Sent: Sunday, March 27, 2022 6:46:56 PM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: Re: [magicu-l] Magic Batch Files

 

Perfect, thanks Roberto, this is exactly what I was looking for.

 

Regards,

 

Buster

 

On Monday, 28 March 2022, 08:43:54 am AEST, Roberto Ramirez Cervantes <marionette_66@...> wrote:

 

 

For example, create an expression like this:

'cmd \c xcopy '&trim(A)&trim(B)&' '&Trim(C)

where

A = Source Path (with \ at the end)
B = File types to copy (*.txt)
C = Destination Path  (with \ at the end)

Use this expression with the "Invoke OS Command" operation, set the wait parameter to "Yes"

Roberto

-------------------------------------------------------------------------------------------------
This e-mail may contain confidential and/or privileged information. If you are not the
intended receipient (or have received this e-mail in error) please notify the sender
immediately and destroy this e-mail.
Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly
forbidden.

Deze e-mail kan vertrouwelijke en/of persoonlijke informatie bevatten. Als u niet de bedoelde
ontvanger bent, of deze e-mail per ongeluk heeft gekregen, breng dan de verzender
ogenblikkelijk hiervan op de hoogte en vernietig dit bericht.
Het kopieren, in de openbaarheid brengen of verspreiden van de inhoud van deze e-mail is ten
strengste verboden.

Ce courriel peut contenir des informations confidentielles et/ou privilegiees. Si ce courriel ne vous est pas destine
(ou vous avez recu ce courriel par erreur) svp, avertissez immediatement la personne qui a envoye ce courriel et detruisez le.
Toute copie non autorisee, divulgation des informations ou distribution du contenu de ce courriel sont strictement interdites.
-------------------------------------------------------------------------------------------------


Re: Magic Batch Files

Tim Downie
 

Off the top of my head there is a fu crion fileinfo or somthing like this...you pass it a file name and the attribute you want
From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of buster reinke via groups.io <buster_png@...>
Sent: Thursday, 7 April 2022 2:13 PM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: Re: [magicu-l] Magic Batch Files
 
Hi all, I have another question regarding Batch Files. I have created another OS Com line that will allow the user to restore the system to the start of the day, by going to the sqlite.SQLite backup file that is created at the beginning of each day and copying it over the current sqlite.SQLite file. This file is overwritten each day to ensure that the restore will not go back any further than today. Is there an easy way to create an expression that gets Magic to first check the date of the file it is about to copy for the restore process to ensure that it is dated today? (I want to put this in as a safety device in the event that for some reason, the daily backup hasn't taken place. I don't want the user to revert back to an old backup any earlier than the beginning of the day) If the date is not todays date, then I want Magic to ignore the copy command.

If anyone is able to help, could you please give me an example of the expression I should use?

Thanks,

Buster

On Thursday, 31 March 2022, 10:26:48 pm AEST, Keith Canniff <kcanniff@...> wrote:


This is more of a Magic 101 response. How to insulate your application as much as possible from the outside world.

 

As a suggestion, anytime you’re working with external processes, it’s best to wrap them in a magic program. What I mean is that in your example below, the external OS command would be in a standalone program (or could be a Magic function) that receives the parameters that are then inserted into the OS command.

 

This has several advantages

 

  1. Only one program has to have the OS command logic in it so its syntax, etc. can be unit tested and you never have to worry about it again.
  2. Every other program in the application can call this program/function and send it normal parameters.
  3. If you ever decide to change the contents of the program/function (use C# snippet, Merge, cmd, whatever), only one program has to be changed and the rest of the application doesn’t care. It still calls the same program/function unchanged.

 

Keith Canniff

 

From: main@magicu-l.groups.io <main@magicu-l.groups.io> On Behalf Of Jeroen Bos via groups.io
Sent: Thursday, March 31, 2022 4:00 AM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Magic Batch Files

 

Instead of using merge, it is also possible to do it with an export to file with a cmd (Windows) or sh (Linux/Unix) extension and afterwards call the just exported file . The only thing you shouldn’t forget is when your on Linux/Unix, is to set the execution bit after exporting….

 

Met vriendelijke groet / Yours sincerely

De bronafbeelding bekijken
 

 


Jeroen Bos | Technisch Consultant (Technical Consultant)

Lekkerland Nederland B.V. | Ekkersrijt 7601 | 5692 HR Son

+31 (0) 40 264 4400 

jeroen.bos@...

www.lekkerland.nl | www.lekkerland24.nl

De bronafbeelding bekijken
 


Volg ons op              

 

 

Van: main@magicu-l.groups.io <main@magicu-l.groups.io> Namens Micha Weiss via groups.io
Verzonden: donderdag 31 maart 2022 07:59
Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] Magic Batch Files

 

When it comes to complex building dynamically on the fly scripts, using MERGE is  a good option as well.

We are using  MERGE to build ftp scripts dynamically. Here is Example for such template

Micha

HUJI

 

open <!$MG_Server>

<!$MG_User>

<!$MG_Password>

 

<!$MGIF_AsciiTransfer>ascii<!$MGENDIF>

<!$MGIF_BinaryTRansfer>binary<!$MGENDIF>

 

prompt

 

cd <!$MG_RemoteDir>

 

<!$MGIF_GetFile>

 

lcd "<!$MG_LocalFilePath>"

 

mget "<!$MG_RemoteFileMaskName>"

 

<!$MGIF_DeleteFileAtServer>mdel <!$MG_RemoteFileMaskName><!$MGIF_AllVersionsAtServer>;*<!$MGENDIF><!$MGENDIF>

 

<!$MGENDIF>

 

<!$MGIF_PutFile>

 

mput "<!$MG_LocalFilePathAndMaskName>"

 

<!$MGENDIF>

 

close

bye

 

 

 

 

 

From: main@magicu-l.groups.io <main@magicu-l.groups.io> On Behalf Of buster reinke via groups.io
Sent: Monday, March 28, 2022 7:10 AM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Magic Batch Files

 

Thanks Keith, I went with Roberto’s method as I prefer to use internal Magic stuff when I can. It works very well, and now I don’t need to bother with the batch files.

 

Buster

On Monday, March 28, 2022, 2:06 pm, Keith Canniff <kcanniff@...> wrote:

Buster

 

You can easily pass parameters to a batch file

 

 


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of buster reinke via groups.io <buster_png@...>
Sent: Sunday, March 27, 2022 6:46:56 PM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: Re: [magicu-l] Magic Batch Files

 

Perfect, thanks Roberto, this is exactly what I was looking for.

 

Regards,

 

Buster

 

On Monday, 28 March 2022, 08:43:54 am AEST, Roberto Ramirez Cervantes <marionette_66@...> wrote:

 

 

For example, create an expression like this:

'cmd \c xcopy '&trim(A)&trim(B)&' '&Trim(C)

where

A = Source Path (with \ at the end)
B = File types to copy (*.txt)
C = Destination Path  (with \ at the end)

Use this expression with the "Invoke OS Command" operation, set the wait parameter to "Yes"

Roberto

-------------------------------------------------------------------------------------------------
This e-mail may contain confidential and/or privileged information. If you are not the
intended receipient (or have received this e-mail in error) please notify the sender
immediately and destroy this e-mail.
Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly
forbidden.

Deze e-mail kan vertrouwelijke en/of persoonlijke informatie bevatten. Als u niet de bedoelde
ontvanger bent, of deze e-mail per ongeluk heeft gekregen, breng dan de verzender
ogenblikkelijk hiervan op de hoogte en vernietig dit bericht.
Het kopieren, in de openbaarheid brengen of verspreiden van de inhoud van deze e-mail is ten
strengste verboden.

Ce courriel peut contenir des informations confidentielles et/ou privilegiees. Si ce courriel ne vous est pas destine
(ou vous avez recu ce courriel par erreur) svp, avertissez immediatement la personne qui a envoye ce courriel et detruisez le.
Toute copie non autorisee, divulgation des informations ou distribution du contenu de ce courriel sont strictement interdites.
-------------------------------------------------------------------------------------------------


Re: Magic Batch Files

buster reinke
 

Hi all, I have another question regarding Batch Files. I have created another OS Com line that will allow the user to restore the system to the start of the day, by going to the sqlite.SQLite backup file that is created at the beginning of each day and copying it over the current sqlite.SQLite file. This file is overwritten each day to ensure that the restore will not go back any further than today. Is there an easy way to create an expression that gets Magic to first check the date of the file it is about to copy for the restore process to ensure that it is dated today? (I want to put this in as a safety device in the event that for some reason, the daily backup hasn't taken place. I don't want the user to revert back to an old backup any earlier than the beginning of the day) If the date is not todays date, then I want Magic to ignore the copy command.

If anyone is able to help, could you please give me an example of the expression I should use?

Thanks,

Buster

On Thursday, 31 March 2022, 10:26:48 pm AEST, Keith Canniff <kcanniff@...> wrote:


This is more of a Magic 101 response. How to insulate your application as much as possible from the outside world.

 

As a suggestion, anytime you’re working with external processes, it’s best to wrap them in a magic program. What I mean is that in your example below, the external OS command would be in a standalone program (or could be a Magic function) that receives the parameters that are then inserted into the OS command.

 

This has several advantages

 

  1. Only one program has to have the OS command logic in it so its syntax, etc. can be unit tested and you never have to worry about it again.
  2. Every other program in the application can call this program/function and send it normal parameters.
  3. If you ever decide to change the contents of the program/function (use C# snippet, Merge, cmd, whatever), only one program has to be changed and the rest of the application doesn’t care. It still calls the same program/function unchanged.

 

Keith Canniff

 

From: main@magicu-l.groups.io <main@magicu-l.groups.io> On Behalf Of Jeroen Bos via groups.io
Sent: Thursday, March 31, 2022 4:00 AM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Magic Batch Files

 

Instead of using merge, it is also possible to do it with an export to file with a cmd (Windows) or sh (Linux/Unix) extension and afterwards call the just exported file . The only thing you shouldn’t forget is when your on Linux/Unix, is to set the execution bit after exporting….

 

Met vriendelijke groet / Yours sincerely

De bronafbeelding bekijken
 

 


Jeroen Bos | Technisch Consultant (Technical Consultant)

Lekkerland Nederland B.V. | Ekkersrijt 7601 | 5692 HR Son

+31 (0) 40 264 4400 

jeroen.bos@...

www.lekkerland.nl | www.lekkerland24.nl

De bronafbeelding bekijken
 


Volg ons op              

 

 

Van: main@magicu-l.groups.io <main@magicu-l.groups.io> Namens Micha Weiss via groups.io
Verzonden: donderdag 31 maart 2022 07:59
Aan: main@magicu-l.groups.io
Onderwerp: Re: [magicu-l] Magic Batch Files

 

When it comes to complex building dynamically on the fly scripts, using MERGE is  a good option as well.

We are using  MERGE to build ftp scripts dynamically. Here is Example for such template

Micha

HUJI

 

open <!$MG_Server>

<!$MG_User>

<!$MG_Password>

 

<!$MGIF_AsciiTransfer>ascii<!$MGENDIF>

<!$MGIF_BinaryTRansfer>binary<!$MGENDIF>

 

prompt

 

cd <!$MG_RemoteDir>

 

<!$MGIF_GetFile>

 

lcd "<!$MG_LocalFilePath>"

 

mget "<!$MG_RemoteFileMaskName>"

 

<!$MGIF_DeleteFileAtServer>mdel <!$MG_RemoteFileMaskName><!$MGIF_AllVersionsAtServer>;*<!$MGENDIF><!$MGENDIF>

 

<!$MGENDIF>

 

<!$MGIF_PutFile>

 

mput "<!$MG_LocalFilePathAndMaskName>"

 

<!$MGENDIF>

 

close

bye

 

 

 

 

 

From: main@magicu-l.groups.io <main@magicu-l.groups.io> On Behalf Of buster reinke via groups.io
Sent: Monday, March 28, 2022 7:10 AM
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Magic Batch Files

 

Thanks Keith, I went with Roberto’s method as I prefer to use internal Magic stuff when I can. It works very well, and now I don’t need to bother with the batch files.

 

Buster

On Monday, March 28, 2022, 2:06 pm, Keith Canniff <kcanniff@...> wrote:

Buster

 

You can easily pass parameters to a batch file

 

 


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of buster reinke via groups.io <buster_png@...>
Sent: Sunday, March 27, 2022 6:46:56 PM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: Re: [magicu-l] Magic Batch Files

 

Perfect, thanks Roberto, this is exactly what I was looking for.

 

Regards,

 

Buster

 

On Monday, 28 March 2022, 08:43:54 am AEST, Roberto Ramirez Cervantes <marionette_66@...> wrote:

 

 

For example, create an expression like this:

'cmd \c xcopy '&trim(A)&trim(B)&' '&Trim(C)

where

A = Source Path (with \ at the end)
B = File types to copy (*.txt)
C = Destination Path  (with \ at the end)

Use this expression with the "Invoke OS Command" operation, set the wait parameter to "Yes"

Roberto

-------------------------------------------------------------------------------------------------
This e-mail may contain confidential and/or privileged information. If you are not the
intended receipient (or have received this e-mail in error) please notify the sender
immediately and destroy this e-mail.
Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly
forbidden.

Deze e-mail kan vertrouwelijke en/of persoonlijke informatie bevatten. Als u niet de bedoelde
ontvanger bent, of deze e-mail per ongeluk heeft gekregen, breng dan de verzender
ogenblikkelijk hiervan op de hoogte en vernietig dit bericht.
Het kopieren, in de openbaarheid brengen of verspreiden van de inhoud van deze e-mail is ten
strengste verboden.

Ce courriel peut contenir des informations confidentielles et/ou privilegiees. Si ce courriel ne vous est pas destine
(ou vous avez recu ce courriel par erreur) svp, avertissez immediatement la personne qui a envoye ce courriel et detruisez le.
Toute copie non autorisee, divulgation des informations ou distribution du contenu de ce courriel sont strictement interdites.
-------------------------------------------------------------------------------------------------


Re: Open UP1.9 Developer in RunTime Mode

Steven Blank
 

Another reason to purchase a Partitioning Server license. MGPART1 can access ANY database. An order picking system I wrote ran for years on desktop clients, relying entirely on an MGPART1 server for access to Oracle tables. The secret operation is Call Remote, which can return results both synchronously and asynchronously. For example, Blobs containing Memory Table images are easy to pass from a Partitioning Server back to a DeskTop client on demand.

Truly, it'll open a whole new world of possibilities for you.

Steven G. Blank
SGBlank Consulting


On 4/6/2022 5:31 PM, Jim Stephenson wrote:
Thanks Steve, I am considering the MGPART license. 

This will be an ongoing process until I can convince the client to switch over completely to the SQL version of this app.

The client only has DeskTop licenses, so we can't open the SQL files from the RunTime they have.

On Wed, Apr 6, 2022 at 6:05 PM Steven Blank <sgblank@...> wrote:
Jim,

Is this a one-off? Or an ongoing operation?

If the latter, I should strongly suggest you consider purchasing an MGPART1 license, also known as Partitioning Lite, 5-threads — well-under a thousand USD, the last I had need.

Then you can call it from the command-line; or from another Magic operation with Call Remote, anywhere on the network; or schedule tasks using Windows Task Scheduler. It does NOT accept http requests, so it's secure by virtue of it's ignorance.

If the former, why not just use the runtime? Why does it need to be the Studio? If it NEEDS to be the Studio, then look into the "Tools Infrastructure" topic and its "Automatic Processing" subsection. It's in the online Help.

Steven G. Blank
SGBlank Consulting


On 4/6/2022 1:59 PM, Jim Stephenson wrote:
I am sure this is a strange request.

I have a need to open a UP1.9 Studio license in RunTime mode and run a specific Program and then close the app.

Is that even possible?

I can run a shortcut that will open UP1.9 and login. But even though I have the INI set to open in mode 'R', it opens in ToolKit mode until I press Ctrl-F7 to go to RunTIme. When I do that it starts the program I told it to run in my record main.

But I need this to be unattended.



Re: Open UP1.9 Developer in RunTime Mode

Jim Stephenson
 

Thanks Steve, I am considering the MGPART license. 

This will be an ongoing process until I can convince the client to switch over completely to the SQL version of this app.

The client only has DeskTop licenses, so we can't open the SQL files from the RunTime they have.

On Wed, Apr 6, 2022 at 6:05 PM Steven Blank <sgblank@...> wrote:
Jim,

Is this a one-off? Or an ongoing operation?

If the latter, I should strongly suggest you consider purchasing an MGPART1 license, also known as Partitioning Lite, 5-threads — well-under a thousand USD, the last I had need.

Then you can call it from the command-line; or from another Magic operation with Call Remote, anywhere on the network; or schedule tasks using Windows Task Scheduler. It does NOT accept http requests, so it's secure by virtue of it's ignorance.

If the former, why not just use the runtime? Why does it need to be the Studio? If it NEEDS to be the Studio, then look into the "Tools Infrastructure" topic and its "Automatic Processing" subsection. It's in the online Help.

Steven G. Blank
SGBlank Consulting


On 4/6/2022 1:59 PM, Jim Stephenson wrote:
I am sure this is a strange request.

I have a need to open a UP1.9 Studio license in RunTime mode and run a specific Program and then close the app.

Is that even possible?

I can run a shortcut that will open UP1.9 and login. But even though I have the INI set to open in mode 'R', it opens in ToolKit mode until I press Ctrl-F7 to go to RunTIme. When I do that it starts the program I told it to run in my record main.

But I need this to be unattended.


Re: Open UP1.9 Developer in RunTime Mode

Steven Blank
 

Jim,

Is this a one-off? Or an ongoing operation?

If the latter, I should strongly suggest you consider purchasing an MGPART1 license, also known as Partitioning Lite, 5-threads — well-under a thousand USD, the last I had need.

Then you can call it from the command-line; or from another Magic operation with Call Remote, anywhere on the network; or schedule tasks using Windows Task Scheduler. It does NOT accept http requests, so it's secure by virtue of it's ignorance.

If the former, why not just use the runtime? Why does it need to be the Studio? If it NEEDS to be the Studio, then look into the "Tools Infrastructure" topic and its "Automatic Processing" subsection. It's in the online Help.

Steven G. Blank
SGBlank Consulting


On 4/6/2022 1:59 PM, Jim Stephenson wrote:
I am sure this is a strange request.

I have a need to open a UP1.9 Studio license in RunTime mode and run a specific Program and then close the app.

Is that even possible?

I can run a shortcut that will open UP1.9 and login. But even though I have the INI set to open in mode 'R', it opens in ToolKit mode until I press Ctrl-F7 to go to RunTIme. When I do that it starts the program I told it to run in my record main.

But I need this to be unattended.


Re: Error 2

buster reinke
 

This is absolutely brilliant Steve. This is going to save me days of grief when developing new programs.

Regards,

Buster




On Thursday, April 7, 2022, 9:49 am, Steven Blank <sgblank@...> wrote:


You can also change the Verify Warning operation so it only writes to the standard error log, typically, mgerror.log — you're always guaranteed to know immediately when something goes bump.


After you've added this LU and learned the source of the problem, if you're tempted to delete it, don't. If nothing else, just disable the entire Logic Unit, intact, by setting it's Condition property to "hard" No.

You're welcome.

Steven G. Blank
SGBlank Consulting



On 4/6/2022 2:47 PM, John Dowbiggin via groups.io wrote:
Thank you Steven - tomorrow’s job


On 6 Apr 2022, at 18:49, Steven Blank <sgblank@...> wrote:


John,

I assume that you're able to reproduce this error at will.

If so, then in your application's Main Program, create a new Event Logic Unit, Event type:Error, Event:Any Error. In this Logic Unit, add a Verify Warning operation and in this operation's Text property, specify an expression that includes at least the following function:

ErrTableName()

I have used the following expression, producing a somewhat more descriptive message:

StrBuild('{ "errTable":"@1@",
  "errName":"@2@",
  "errCode":"@3@" }',
 ErrTableName(), ErrMagicName(), Str(ErrDbmsCode(), 'N10'))

Steven G. Blank
SGBlank Consulting


On 4/6/2022 8:03 AM, John Dowbiggin wrote:

Hi

 

Unipaas 1.9i and Btrieve.

 

Can anyone suggest the quickest wat to identify the corrupted file when you get an error #2.  I am getting it in my most complex program with over 100 files open (at least) and trying to identify the culprit is going to take hours using methods I’m familiar with.

 

Regards

 

John





Re: Error 2

Steven Blank
 


You can also change the Verify Warning operation so it only writes to the standard error log, typically, mgerror.log — you're always guaranteed to know immediately when something goes bump.


After you've added this LU and learned the source of the problem, if you're tempted to delete it, don't. If nothing else, just disable the entire Logic Unit, intact, by setting it's Condition property to "hard" No.

You're welcome.

Steven G. Blank
SGBlank Consulting



On 4/6/2022 2:47 PM, John Dowbiggin via groups.io wrote:
Thank you Steven - tomorrow’s job


On 6 Apr 2022, at 18:49, Steven Blank <sgblank@...> wrote:

 John,

I assume that you're able to reproduce this error at will.

If so, then in your application's Main Program, create a new Event Logic Unit, Event type:Error, Event:Any Error. In this Logic Unit, add a Verify Warning operation and in this operation's Text property, specify an expression that includes at least the following function:

ErrTableName()

I have used the following expression, producing a somewhat more descriptive message:

StrBuild('{ "errTable":"@1@",
  "errName":"@2@",
  "errCode":"@3@" }',
 ErrTableName(), ErrMagicName(), Str(ErrDbmsCode(), 'N10'))


Steven G. Blank
SGBlank Consulting


On 4/6/2022 8:03 AM, John Dowbiggin wrote:

Hi

 

Unipaas 1.9i and Btrieve.

 

Can anyone suggest the quickest wat to identify the corrupted file when you get an error #2.  I am getting it in my most complex program with over 100 files open (at least) and trying to identify the culprit is going to take hours using methods I’m familiar with.

 

Regards

 

John





Re: Error 2

Steven Blank
 

After you've added this LU and learned the source of the problem, if you're tempted to delete it, don't. If nothing else, just disable the entire Logic Unit, intact, by setting it's Condition property to "hard" No.

You're welcome.

Steven G. Blank
SGBlank Consulting



On 4/6/2022 2:47 PM, John Dowbiggin via groups.io wrote:
Thank you Steven - tomorrow’s job


On 6 Apr 2022, at 18:49, Steven Blank <sgblank@...> wrote:

 John,

I assume that you're able to reproduce this error at will.

If so, then in your application's Main Program, create a new Event Logic Unit, Event type:Error, Event:Any Error. In this Logic Unit, add a Verify Warning operation and in this operation's Text property, specify an expression that includes at least the following function:

ErrTableName()

I have used the following expression, producing a somewhat more descriptive message:

StrBuild('{ "errTable":"@1@",
  "errName":"@2@",
  "errCode":"@3@" }',
 ErrTableName(), ErrMagicName(), Str(ErrDbmsCode(), 'N10'))


Steven G. Blank
SGBlank Consulting


On 4/6/2022 8:03 AM, John Dowbiggin wrote:

Hi

 

Unipaas 1.9i and Btrieve.

 

Can anyone suggest the quickest wat to identify the corrupted file when you get an error #2.  I am getting it in my most complex program with over 100 files open (at least) and trying to identify the culprit is going to take hours using methods I’m familiar with.

 

Regards

 

John




Re: Error 2

John Dowbiggin
 

Thank you Steven - tomorrow’s job


On 6 Apr 2022, at 18:49, Steven Blank <sgblank@...> wrote:

 John,

I assume that you're able to reproduce this error at will.

If so, then in your application's Main Program, create a new Event Logic Unit, Event type:Error, Event:Any Error. In this Logic Unit, add a Verify Warning operation and in this operation's Text property, specify an expression that includes at least the following function:

ErrTableName()

I have used the following expression, producing a somewhat more descriptive message:

StrBuild('{ "errTable":"@1@",
  "errName":"@2@",
  "errCode":"@3@" }',
 ErrTableName(), ErrMagicName(), Str(ErrDbmsCode(), 'N10'))


Steven G. Blank
SGBlank Consulting


On 4/6/2022 8:03 AM, John Dowbiggin wrote:

Hi

 

Unipaas 1.9i and Btrieve.

 

Can anyone suggest the quickest wat to identify the corrupted file when you get an error #2.  I am getting it in my most complex program with over 100 files open (at least) and trying to identify the culprit is going to take hours using methods I’m familiar with.

 

Regards

 

John



Open UP1.9 Developer in RunTime Mode

Jim Stephenson
 

I am sure this is a strange request.

I have a need to open a UP1.9 Studio license in RunTime mode and run a specific Program and then close the app.

Is that even possible?

I can run a shortcut that will open UP1.9 and login. But even though I have the INI set to open in mode 'R', it opens in ToolKit mode until I press Ctrl-F7 to go to RunTIme. When I do that it starts the program I told it to run in my record main.

But I need this to be unattended.


Re: Error 2

Steven Blank
 

John,

I assume that you're able to reproduce this error at will.

If so, then in your application's Main Program, create a new Event Logic Unit, Event type:Error, Event:Any Error. In this Logic Unit, add a Verify Warning operation and in this operation's Text property, specify an expression that includes at least the following function:

ErrTableName()

I have used the following expression, producing a somewhat more descriptive message:

StrBuild('{ "errTable":"@1@",
  "errName":"@2@",
  "errCode":"@3@" }',
 ErrTableName(), ErrMagicName(), Str(ErrDbmsCode(), 'N10'))


Steven G. Blank
SGBlank Consulting


On 4/6/2022 8:03 AM, John Dowbiggin wrote:

Hi

 

Unipaas 1.9i and Btrieve.

 

Can anyone suggest the quickest wat to identify the corrupted file when you get an error #2.  I am getting it in my most complex program with over 100 files open (at least) and trying to identify the culprit is going to take hours using methods I’m familiar with.

 

Regards

 

John



Re: Error 2

Wes Hein
 

Make a backup, run the Pervasive Rebuild on your files.  The error log will show any files it can't fix.

Wes

Wes Hein

Principal Software Engineer

P: 503.751.2537  

E: wes.hein@...  

Springbrook Community

govtech_100

The company accepts no liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. If you are not the intended recipient you are notified disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.


Re: Error 2

Danica Majernikova
 

It could be debugger in unipaas


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of John Dowbiggin <john@...>
Sent: April 6, 2022 11:57 AM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: Re: [magicu-l] Error 2
 

Hi Danica

Sorry to be ignorant but how do I run monitor.  I am assuming it is NOT broker monitor but I can’t find anything else that fits.

 

John

 

From: main@magicu-l.groups.io <main@magicu-l.groups.io> On Behalf Of Danica Majernikova
Sent: 06 April 2022 16:42
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Error 2

 

Run Monitor, leave it open on the screen and don't click OK on the error message. In the monitor you find last performed task, it gives you an idea what is the next subtask/task not performed, where the corrupted file should be open


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of John Dowbiggin <john@...>
Sent: April 6, 2022 11:03 AM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: [magicu-l] Error 2

 

Hi

 

Unipaas 1.9i and Btrieve.

 

Can anyone suggest the quickest wat to identify the corrupted file when you get an error #2.  I am getting it in my most complex program with over 100 files open (at least) and trying to identify the culprit is going to take hours using methods I’m familiar with.

 

Regards

 

John


Re: Error 2

John Dowbiggin
 

Hi Danica

Sorry to be ignorant but how do I run monitor.  I am assuming it is NOT broker monitor but I can’t find anything else that fits.

 

John

 

From: main@magicu-l.groups.io <main@magicu-l.groups.io> On Behalf Of Danica Majernikova
Sent: 06 April 2022 16:42
To: main@magicu-l.groups.io
Subject: Re: [magicu-l] Error 2

 

Run Monitor, leave it open on the screen and don't click OK on the error message. In the monitor you find last performed task, it gives you an idea what is the next subtask/task not performed, where the corrupted file should be open


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of John Dowbiggin <john@...>
Sent: April 6, 2022 11:03 AM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: [magicu-l] Error 2

 

Hi

 

Unipaas 1.9i and Btrieve.

 

Can anyone suggest the quickest wat to identify the corrupted file when you get an error #2.  I am getting it in my most complex program with over 100 files open (at least) and trying to identify the culprit is going to take hours using methods I’m familiar with.

 

Regards

 

John


Re: Error 2

Danica Majernikova
 

Run Monitor, leave it open on the screen and don't click OK on the error message. In the monitor you find last performed task, it gives you an idea what is the next subtask/task not performed, where the corrupted file should be open


From: main@magicu-l.groups.io <main@magicu-l.groups.io> on behalf of John Dowbiggin <john@...>
Sent: April 6, 2022 11:03 AM
To: main@magicu-l.groups.io <main@magicu-l.groups.io>
Subject: [magicu-l] Error 2
 

Hi

 

Unipaas 1.9i and Btrieve.

 

Can anyone suggest the quickest wat to identify the corrupted file when you get an error #2.  I am getting it in my most complex program with over 100 files open (at least) and trying to identify the culprit is going to take hours using methods I’m familiar with.

 

Regards

 

John


Re: Error 2

John Dowbiggin
 

Checked – nothing significant in there

 

From: main@magicu-l.groups.io <main@magicu-l.groups.io> On Behalf Of John Knickerbocker
Sent: 06 April 2022 16:08
To: Magic Users Group <main@magicu-l.groups.io>
Subject: Re: [magicu-l] Error 2

 

Log file. Mgerror?

 

On Wed, Apr 6, 2022, 6:03 PM John Dowbiggin <john@...> wrote:

Hi

 

Unipaas 1.9i and Btrieve.

 

Can anyone suggest the quickest wat to identify the corrupted file when you get an error #2.  I am getting it in my most complex program with over 100 files open (at least) and trying to identify the culprit is going to take hours using methods I’m familiar with.

 

Regards

 

John

581 - 600 of 196209