Como transformar esta rutina / Could it be used? - Forum

Forum Navigation
You need to log in to create posts and topics.

Como transformar esta rutina / Could it be used?

@gaev

Hola el objetivo es poder obtener a partir de la fecha actual un vencimiento a los 360 dias es decir al año pero el resultado solo debe ser mostrado
en formato   mm/yy es decir solo en numero del mes y el año del vencimiento

Uso para esta rutina el plug dec_plus de david esperalta

tengo esta rutina que uso en vencimientos de cuotas pero me da el vencimiento el vencimiento completo con palabras se podra tomar y adaptar?

rutina al final...

@gaev,  Hello, the objective is to be able to obtain from the current date an expiration of 360 days, that is, a year, but the result should only be shown
in mm/yy format, that is, only in the number of the month and the year of expiration.

I have this routine that I use for installment due dates but it gives me the full due date with words. Could it be taken and adapted?

sorry i use plugin dec_plus for dec_incrementarDecrementarFecha

dec_IncrementarDecrementarFecha "[dia]/[mes]/[año]" "360"
Setvar "[date]" "![dec_resultado]"
DateToNum "![date]" "Default" "[numDate]"
SetVar "[numDayFormat]" "dd"
NumToDate "[numDate]" "[numDayFormat]" "[numDay]"
SetVar "[nameMonthFormat]" "mmmm"
NumToDate "[numDate]" "[nameMonthFormat]" "[nameMonth]"
SetVar "[numYearFormat]" "yyyy"
NumToDate "[numDate]" "[numYearFormat]" "[numYear]"
Setvar "[vencimiento1]" "[numDay] de [nameMonth] de [numYear]"

Thanks

dec_IncrementarDecrementarFecha "[dia].[mes].[ano]" "360"
If "[dec_resultado]" "=" "Error"
    AlertBox "Error" "Invalid date!"
    Return
EndIf
StrParse "[dec_resultado]" "." "[date]" ""

SetVar "[numDay]" "[date1]"
SetVar "[nameMonth]" "[date2]"
SetVar "[numYear]" "[date3]"

Setvar "[vencimiento1]" "[numDay] de [nameMonth] de [numYear]"

Date format
[dia] = 01-31
[mes] = 01-12
[ano] = 2024

 

You don't understand what you are writing. If you don't understand something, read the help. The developers did a very good job both in writing the program and in writing the reference manual. Many questions will disappear by themselves.

If the variables [numDay], [nameMonth], [numYear] are not needed, then you can write it like this:

dec_IncrementarDecrementarFecha "[dia].[mes].[ano]" "360"
If "[dec_resultado]" "=" "Error"
    AlertBox "Error" "Invalid date!"
    Return
EndIf
StrParse "[dec_resultado]" "." "[date]" ""

Setvar "[vencimiento1]" "[date1] de [date2] de [date3]"

 

@mishem

The result that I should obtain to print must be
03 / 24
that is, the first two numbers of the month and the last two of the year...
Currently my routine gives me everything complete but in text format.

 

@joferar333

the objective is to be able to obtain from the current date an expiration of 360 days, that is, a year, but the result should only be shown
in mm/yy format, that is, only in the number of the month and the year of expiration.

I thought this (or a very similar) question was asked and answered recently ... you don't need any plugins for this as VisualNEOWin commands can do everything you need ...

SetVar "[dateStart]" "![MonthNum]/[DayNum]/[Year]"
SetVar "[daysIncrement]" "360"


DateToNum "[dateStart]" "m/d/y" "[dateStartNum]"
Math "[dateStartNum]+[daysIncrement]" "0" "[dateEndNum]"
NumToDate "[dateEndNum]" "mm/yy" "[answerDate]"

... replace separator - with /
StrReplace "[answerDate]" "-" "/" "[answerDate]" ""

AlertBox "Answer" "[answerDate]"

Study the VisualNEOWin commands here ... https://winhelp.visualneo.com/Control.html#DATETONUM

... replace separator - with /
StrReplace "[answerDate]" "-" "/" "[answerDate]" ""
Depending on the regional system settings, this will not work correctly. Action:

NumToDate "[dateEndNum]" "mm/yy" "[answerDate]"

On my system it will return a dot, not -
Gaev has reacted to this post.
Gaev

@mishem

Depending on the regional system settings, this will not work correctly.
On my system it will return a dot, not -

 

StrReplace "[answerDate]" "!." "/" "[answerDate]" ""