Android Question Comment links with date and time

Martin Larsen

Active Member
Licensed User
Longtime User
Is it possible to somehow add the current date and time to comment links? Like below:

B4X:
'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project_%date%_%time%.zip
 

DonManfred

Expert
Licensed User
Longtime User
Is it possible to somehow add the current date and time to comment links? Like below:

Notes
  • Spaces should be replaced with +.
  • The parameters values are url decoded.
  • The ide://run method supports these additional arguments:
    • FilesSync=True - Causes the IDE to sync the Files folder after operation completes.
    • CleanProject=True - Causes the IDE to clean the project after operation completes.
    • VMArgs - Similar to Args but added as a JVM argument.
      You can add: VMArgs=-DZeroSharedFiles%3DTrue to a zipper call to delete the content of the platform specific copies of shared files (the content will be added back when the program runs, because of the custom build action).
  • The parameter values can include the following case sensitive aliases:
    • %B4X% - installation folder.
    • %PROJECT% - project folder (location of the project .B4? file).
    • %JAVABIN% - configured java bin folder (not available in beta #1)
    • %ADDITIONAL% - Platform specific additional libraries folder.
    • Any other environment variable

    • Setup an ENV Var with the Date you want to use. Use this ENV Var then.
 
Upvote 0

Martin Larsen

Active Member
Licensed User
Longtime User
Well, I did notice that, but to my knowledge there are no environment variables for date and time.

Or are there?
 
Upvote 0

Martin Larsen

Active Member
Licensed User
Longtime User
Setup an ENV Var with the Date you want to use. Use this ENV Var then.

This sort of contradicts the use case. I want it to change the file name according to the current time. If I setup an ENV var, I could just as well hardcode the time etc :)
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Any other environment variable
I think that sentence refers to B4X environments, not system ones.

These:
The parameter values can include the following case sensitive aliases:
  • %B4X% - installation folder.
  • %PROJECT% - project folder (location of the project .B4? file).
  • %JAVABIN% - configured java bin folder (not available in beta #1)
  • %ADDITIONAL% - Platform specific additional libraries folder.
are not system environment variables.
 
Upvote 0

Martin Larsen

Active Member
Licensed User
Longtime User
I really don't think it is clear, given that apparently there are no other B4X environment variables documented anywhere.

Only Erel knows :)

PS. And the fact that two of us understand it as system variables proofs that it is not that clear! ;)
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Upvote 0

Martin Larsen

Active Member
Licensed User
Longtime User
It doesn't really makes it clearer to me :)

The current placeholders are: PROJECT, ADDITIONAL (additional libraries folder), B4X (installation folder) and all the environmental variables.

All the environmental variables? Which environment variables if not system variables?

I think the statement makes most sense with system vars included.
 
Upvote 0

Martin Larsen

Active Member
Licensed User
Longtime User
It is system environment variables!!!

Proof:

B4X:
'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=Project_%COMPUTERNAME%.zip

Works!

But not DATE and TIME, for some reason.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
I think it is because they are not 'real' environment variables but are 'virtual' ones recognised by the shell but not actually existing in the environment variable table.
It is system environment variables!!!
Well, they seem to be a "mix" of system & B4X/IDE environment variables, since not even %B4X% is a "real Windows (!) variable".
 
Upvote 0

Lucas Siqueira

Active Member
Licensed User
Longtime User
I modified Ziper to have the %B4XDATETIME% function that displays date and time in the format _yyyyMMdd_HHmmss
yyyy=year, MM=month, dd=day, HH=hour, mm=minute and ss=second

Exemple in use:
'Ctrl + click to export as zip: ide://run?File=%B4X%\Zipper.jar&Args=%PROJECT_NAME%_%B4XDATETIME%.zip

Copy the Zipper.jar file to the IDE folder (B4A, B4I, B4J).
Exemple: C:\B4X\IDE\B4A

1702170162759.png
 

Attachments

  • B4XPagesZipperModified.zip
    4.9 KB · Views: 100
  • Zipper.jar
    173.6 KB · Views: 84
Upvote 0
Top