Access field value from previous record

441 views
Skip to first unread message

Timothy Leung

unread,
Feb 4, 2017, 12:49:25 PM2/4/17
to mementodatabase
My apologies if this topic was discussed in the past.
I want to set up a library with a field to calculate the sum of a field in the current record and that of the same field in the previous record:

X : Integer
N : Calculated
N = X + X' (X from the previous record)

Can this be done?

Bill Crews

unread,
Feb 4, 2017, 4:41:30 PM2/4/17
to mementodatabase
Sure. See the following wiki page: http://wiki.mementodatabase.com/index.php/Triggers#Libraries_Examples

That page tells you about triggers and the JavaScript objects that support them. If you click on the link to the Libraries Examples in the companion page Trigger Examples, you'll see a code snippet you should be able to use. If you know a smattering of JavaScript, you should be able to doctor that code to do what you want.

Timothy Leung

unread,
Feb 4, 2017, 11:41:35 PM2/4/17
to mementodatabase
Thanks for the tip.

Lucidio Ferreira

unread,
Jul 9, 2020, 3:30:38 PM7/9/20
to mementodatabase
Friend Timothy Leung
I would like to know how you solved this calculation with the previous field, see in the annex I need the previous mileage to be pulled into the calculation with the current mileage, you know? Here's what I'm trying to do.

Campo1.png

Campo2.png




Em domingo, 5 de fevereiro de 2017 01:41:35 UTC-3, Timothy Leung escreveu:
Thanks for the tip.

Ernst Moser

unread,
Jul 9, 2020, 4:41:36 PM7/9/20
to mementodatabase
function LS(ort){
var ort1 = ort
var libclients = lib (); //Dise  Datenbank aufrufen
var entries = libclients.entries(ort1); // alle daten von name holen
var entry = entries[0];
var l = entries.length;   // L ist die anzahl der Daten
if(l>1) {
var zahl = entries[0].field(ort1);

return zahl ;
}
}
// Aufruf
var e=entry()
var Va1 = "odometro atual"
var Va2 = "odometro anterior"
e.set(Va1,LS(Va2))

Ernst Moser

unread,
Jul 9, 2020, 4:45:41 PM7/9/20
to mementodatabase
Hallo
Versuche das Skript von Vorpost . Es muss in " Einen Eintrag erstellen / Öffnen einer Eingabebesätigungskarte " eingetragen werden .

Hello
Try the pre-post script. It must be entered in "Create an Entry / Open an Entry Confirmation Card".

Lucidio Ferreira

unread,
Jul 10, 2020, 4:57:21 PM7/10/20
to mementodatabase
Hello

I am a beginner and I am having difficulty solving this situation. I made a field in java as attached, but it didn't work.

Screenshot_2020-07-10-12-46-53-934_com.luckydroid.droidbase.jpg

IMG_20200710_124819.jpg

IMG_20200710_124851.jpg

Ernst Moser

unread,
Jul 10, 2020, 5:36:59 PM7/10/20
to mementodatabase
Hallo
Das Skript gehört nicht in ein Feld sondern :Du Wischt von rechten Rand , nach Links . Da erscheint eine Menüleiste -> JS auswählen -> Blaues Plus -> Auslöser auswählen -> Ereignis = Einen Eintrag erstellen  / Phase = Öffnen einer Eingabebestätigungskarte / unter Script gehöre das Kopiert .

Hello
The script does not belong in a field but rather: You swipe from the right edge, to the left. There appears a menu bar -> select JS -> blue plus -> select trigger -> event = create an entry / phase = open an input confirmation card / under script the copy belongs.

Beth Dixon

unread,
Jul 10, 2020, 7:04:16 PM7/10/20
to Lucidio Ferreira, mementodatabase
Also not sure if you have done this? Tap on adicionar...and add Memento JavaScript libraries.

--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/39ba0f3b-def5-4979-b99e-1e1531b474a8o%40googlegroups.com.
- Beth
Screenshot_2020-07-10-12-46-53-934_com.luckydroid.droidbase.jpg
IMG_20200710_124819.jpg
IMG_20200710_124851.jpg

Lucidio Ferreira

unread,
Jul 11, 2020, 8:03:58 AM7/11/20
to mementodatabase
Hello Moser
Almost giving up. I do the script steps something is wrong. I can't solve it.

Screenshot_2020-07-11-08-50-48-000_com.luckydroid.droidbase.jpg

Screenshot_2020-07-11-08-48-59-879_com.luckydroid.droidbase.jpg

Screenshot_2020-07-11-08-50-41-977_com.luckydroid.droidbase.jpg

Screenshot_2020-07-11-08-50-27-557_com.luckydroid.droidbase.jpg

Screenshot_2020-07-11-08-50-14-524_com.luckydroid.droidbase.jpg

Screenshot_2020-07-11-08-51-19-721_com.luckydroid.droidbase.jpg




Em sexta-feira, 10 de julho de 2020 18:36:59 UTC-3, Ernst Moser escreveu:
Olá
O script não pertence a um campo, mas: você desliza da borda direita para a esquerda. Uma barra de menus é exibida -> selecione JS -> azul mais -> selecione gatilho -> evento = crie uma entrada / fase = abra um cartão de confirmação de entrada / no script à qual a cópia pertence.

Olá
O script não pertence a um campo, mas sim: você desliza da borda direita para a esquerda. Aparece uma barra de menus -> selecione JS -> azul mais -> selecione gatilho -> evento = crie uma entrada / fase = abra um cartão de confirmação de entrada / no script em que a cópia pertence.

Na sexta-feira, 10 de julho de 2020 22:57:21 UTC + 2 Lucidio Ferreira escreveu:
Olá

Sou iniciante e estou tendo dificuldades para resolver esta situação. Eu criei um campo em java como anexado, mas não funcionou.

Screenshot_2020-07-10-12-46-53-934_com.luckydroid.droidbase.jpg

IMG_20200710_124819.jpg

IMG_20200710_124851.jpg







Em quinta-feira, 9 de julho de 2020 17:45:41 UTC-3, Ernst Moser escreveu:
Olá
Experimente o script pré-pós. Ele deve ser inserido em "Criar uma entrada / Abrir um cartão de confirmação de entrada".

Olá
Experimente o script pré-pós. Ele deve ser inserido em "Criar uma entrada / Abrir um cartão de confirmação de entrada".

Na quinta-feira, 9 de julho de 2020 22:41:36 UTC + 2, Ernst Moser escreveu:
função LS (local) {
var local1 = local
var libclients = lib (); // chama este banco de dados
var inputs = libclients.entries (ort1); // obtém todos os dados do nome
var entry = entradas [0];
var l = entradas.length; // L é o número de dados
if (l> 1) {
var number = entry [0] .field (place1);

número de retorno;
}
}
// Ligue para
var e = entry ()
var Va1 = "odometro atual"
var Va2 = "odometro anterior"
e.set (Va1, LS (Va2))

na quinta-feira, 9 de julho de 2020 21:30:38 UTC + 2 escreveu Lucídio Ferreira:
Amigo Timothy Leung
Eu gostaria de saber como você resolveu esse cálculo com o campo anterior, veja no anexo que eu preciso que a milhagem anterior seja puxada para o cálculo com a milhagem atual, sabe? Aqui está o que estou tentando fazer.

Campo1.png

Campo2.png




Em domingo, 5 de fevereiro de 2017 01:41:35 UTC-3, Timothy Leung escreveu:
Obrigado pela dica.

Ernst Moser

unread,
Jul 11, 2020, 8:22:35 AM7/11/20
to mementodatabase
Hallo
Da sind wir schon mal einige Schritte weiter . Der Fehler ligt in der Schreibweise der Feldnahmen . Du musst in der Zeile wo Steht " var Va1 = " den Namen des Feldes richtig stellen ( auch Groß / Kleinschreibung beachten  ) und die Zeile darunter ebenso .

Hello
We are already a few steps further. The mistake is in the spelling of the field names. You have to correct the name of the field in the line where "var Va1 =" (also case sensitive) and the line below.

Beth Dixon

unread,
Jul 11, 2020, 9:57:11 AM7/11/20
to Lucidio Ferreira, mementodatabase
Lucidio, from your screenshot you still have not added JavaScript libraries.  Once you fix your code with Ernst help it still won't work if you have not done this.

- Beth

--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
Screenshot_20200711_095007_com.android.chrome.jpg
Screenshot_20200711_094549_com.luckydroid.droidbase.jpg

Lucidio Ferreira

unread,
Jul 11, 2020, 1:35:33 PM7/11/20
to mementodatabase
Hello Beth

Still with error but see the name of the error that appears in the above attachment

Screenshot_2020-07-11-14-29-13-421_com.luckydroid.droidbase.jpg

Screenshot_2020-07-11-14-29-25-666_com.luckydroid.droidbase.jpg

Screenshot_2020-07-11-14-28-51-364_com.luckydroid.droidbase.jpg

Screenshot_2020-07-11-14-28-57-125_com.luckydroid.droidbase.jpg

Screenshot_2020-07-11-14-29-07-597_com.luckydroid.droidbase.jpg




Em sábado, 11 de julho de 2020 10:57:11 UTC-3, Beth Dixon escreveu:
Lucidio, from your screenshot you still have not added JavaScript libraries.  Once you fix your code with Ernst help it still won't work if you have not done this.

- Beth

On Thu, Jul 9, 2020, 3:30 PM Lucidio Ferreira <luci...@gmail.com> wrote:
Friend Timothy Leung
I would like to know how you solved this calculation with the previous field, see in the annex I need the previous mileage to be pulled into the calculation with the current mileage, you know? Here's what I'm trying to do.

Campo1.png

Campo2.png




Em domingo, 5 de fevereiro de 2017 01:41:35 UTC-3, Timothy Leung escreveu:
Thanks for the tip.

--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to memento...@googlegroups.com.

Lucidio Ferreira

unread,
Jul 11, 2020, 3:46:15 PM7/11/20
to mementodatabase
Hello Beth
It seems that I will not succeed. I followed in his footsteps the error continues. For the mistake of knowing where to fix.

Screenshot_2020-07-11-16-41-44-556_com.luckydroid.droidbase.jpg

Screenshot_2020-07-11-16-41-29-170_com.luckydroid.droidbase.jpg




Em sábado, 11 de julho de 2020 10:57:11 UTC-3, Beth Dixon escreveu:
Lucidio, from your screenshot you still have not added JavaScript libraries.  Once you fix your code with Ernst help it still won't work if you have not done this.

- Beth

On Thu, Jul 9, 2020, 3:30 PM Lucidio Ferreira <luci...@gmail.com> wrote:
Friend Timothy Leung
I would like to know how you solved this calculation with the previous field, see in the annex I need the previous mileage to be pulled into the calculation with the current mileage, you know? Here's what I'm trying to do.

Campo1.png

Campo2.png




Em domingo, 5 de fevereiro de 2017 01:41:35 UTC-3, Timothy Leung escreveu:
Thanks for the tip.

--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to memento...@googlegroups.com.

Ernst Moser

unread,
Jul 11, 2020, 4:07:22 PM7/11/20
to mementodatabase
Hallo
Da ist noch der gleiche Fehler . Du musst nicht den Namen von Feld ändern sondern die Namen im Sript . Die Groß und Kleinschreibung ist zu beachten.  "odometro " ist nicht gleich " Odometro " . Du kannst auch zum Testen das Feld einfach " a" nennen und im Sript auch auf " a" ändern .

Hello
There is the same mistake. You don't have to change the name of the field, but the names in the script. The case is case sensitive. "odometro" is not the same as "Odometro". You can also simply call the field "a" for testing and change it to "a" in the script.

Beth Dixon

unread,
Jul 11, 2020, 4:44:15 PM7/11/20
to Ernst Moser, mementodatabase
It is difficult translating to Portuguese for me...Have you changed the trigger ”ao criar uma entrada” to abrindo um cartão de visualização de entrada
As per Ernst?
- Beth

To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/cf8a54d7-7ebf-495e-9ef4-1f58c0e75c09o%40googlegroups.com.
Screenshot_20200711_163848_com.google.android.gm.jpg

Lucidio Ferreira

unread,
Jul 11, 2020, 6:01:25 PM7/11/20
to mementodatabase
Hello
It really keeps giving error even following all the steps.

The error is always this in the script:

erro de script: Typeerror: Cannot call method "set" of null (Activador 2.js#17)

Beth Dixon

unread,
Jul 11, 2020, 6:24:31 PM7/11/20
to Lucidio Ferreira, mementodatabase
I am at a loss.  Maybe someone else can help.

- Beth

To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/6875c2f4-fdad-4468-8052-4256f0e8e855o%40googlegroups.com.

Ernst Moser

unread,
Jul 12, 2020, 2:42:51 AM7/12/20
to mementodatabase
Hallo
Wenn du die Namen richtig gestellt hast und das Skript noch immer nicht funktioniert, dann liegt es wohl an den Einstellungen. Überprüfe wenn der Skript ausgeführt werden soll. Neuer Eintrag erstellen. Nach den speichern. Es müsste nachdem du die Daten eingegeben hast und gespeichert hast müssten die Daten Vorhandensein. Schicke sonst bitte noch mal ein Bild.



Hello
If you have set the names correctly and the script still does not work, then it is probably due to the settings. Check if you want the script to run. Create new entry. According to the store. After you have entered and saved the data, it should be available. Otherwise please send a picture again.

Gilles Mons

unread,
Jul 12, 2020, 2:55:14 AM7/12/20
to Lucidio Ferreira, mementodatabase
Lucidio ....

I think your problem comes from the fact that you cannot use "e.set ()" when creating a record

try registration ???

or then in a Javacript field ??

To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/6875c2f4-fdad-4468-8052-4256f0e8e855o%40googlegroups.com.

Lucidio Ferreira

unread,
Jul 12, 2020, 7:44:29 AM7/12/20
to mementodatabase
In fact I downloaded the existing Fuel Log library and tried to improve it without needing to always put the previous odometer, but unfortunately I couldn't. If someone can help me and send me the script calculation already working thank you.
Modelo Fuel Log.docx

Ernst Moser

unread,
Jul 12, 2020, 8:58:53 AM7/12/20
to mementodatabase
Hallo
Versuchen wir einen anderen Weg .Lade deine Bibliothek in die Cloud hoch . Diese Vorgang ist von Handy aus erglärt . Tippe auf die Wolke ( Cloud ) -> Im Fenster hast du die " Adresse der Sammlung " ( http://libs.mobi/ .......) Dies Adresse stellst du hir ein ( Veröffentlichen ) -> unten hast du " Wer hat Zugriff " -> da muss du auf "Allgemeine Zutritt " Tippen -> In Sammlungsberechtigungen alle auf " Zulassen " Stellen -> Speichern . Ich kann mir deine Bibliothek herunter Laden und änderungen machen / Testen . Melde dich wenn du es so machen willst

Hello
Let's try another way. Upload your library to the cloud. This process is explained from a cell phone. Tap on the cloud (cloud) -> In the window you have the "address of the collection" (http://libs.mobi/ .......) You set this address here (publish) -> below you have "Who has access" -> then you have to tap on "General access" -> In collection permissions, all set to "Allow" -> Save. I can download your library and make changes / tests. Get in touch if you want to do it like this

Gilles Mons

unread,
Feb 19, 2021, 4:09:14 PM2/19/21
to Ernst Moser, mementodatabase
Bonjour Ernst,

Une précision
Et une question...

Précision:

Pour la ligne

if(l>1)

Il est préférable d'écrire

if(l>0)

Sinon cela ne fonctionne pas au premier enregistrement...


Je cherche à utiliser votre fonction/Script pour un champ "date",
que je formate avec 

moment ().format("DD/MM/YY")

Pourriez m'aider....

Merci.


Hallo Ernst,

Eine Präzision Und eine Frage...
Präzision:

Für die Linie wenn (l> 1) Es ist besser zu schreiben wenn (l> 0) Sonst funktioniert es bei der ersten Aufnahme nicht...

Ich möchte Ihre Funktion / Ihr Skript für ein "Datums" -Feld verwenden.

mit dem ich formatiere

moment().format ("DD /MM/YY")

Könnte mir helfen....

Danke.


Hello Ernst,

A precision 
And a question...

Precision:

For the line

if (l> 1)

It is better to write

if (l> 0) 

Otherwise it doesn't work on the first recording...

I'm looking to use your function / Script for a "date" field, that I format with

moment().format ("DD / MM / YY")

Could help me....

Thank you.


--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.

Er Mo

unread,
Feb 20, 2021, 11:33:07 AM2/20/21
to mementodatabase
Hallo Gilles
Das Skript hat die Aufgabe eine Wert von Vorigen Datensatz zu holen und in den Aktuellen zu Schreiben . Das müsst mit einen Datum auch so gehen .

Bonjour Gilles
Le script a pour tâche d'extraire une valeur de l'ensemble de données précédent et de l'écrire dans celui en cours. Cela doit aussi accompagner une date.

Gilles Mons

unread,
Feb 20, 2021, 12:05:13 PM2/20/21
to Er Mo, mementodatabase
Bonjour Er Mo,

Malheureusement je n'y arrive pas....

Voici ce que j'obtiens (Voir Photo jointe )

Hallo Er Mo,

Leider kann ich nicht ... Folgendes bekomme ich (siehe Foto im Anhang)

Screenshot_20210220-180201_Memento Database.jpg

Gilles Mons

unread,
Feb 20, 2021, 12:13:26 PM2/20/21
to Er Mo, mementodatabase
Voici la table pour mes test...

Hier ist die Tabelle für meine Tests ...

Er Mo

unread,
Feb 20, 2021, 2:01:42 PM2/20/21
to mementodatabase
Hallo Gilles
Die Funktion hold das Letzte Datum und Schreibt es in ein TEXT Feld . Das Skript Feld macht die Formatirung .

Bonjour Gilles
La fonction contient la dernière date et l'écrit dans un champ TEXTE. Le champ de script effectue le formatage.

Gilles Mons

unread,
Feb 20, 2021, 4:40:12 PM2/20/21
to Er Mo, mementodatabase
Er Mo,

Sie haben keinen autorisierten Zugriff auf die Tabelle... 

Danke


Er Mo

unread,
Feb 21, 2021, 3:28:03 AM2/21/21
to mementodatabase
Hallo
Habe es freigegeben .

salut
Je l'ai partagé.


Gilles Mons

unread,
Feb 21, 2021, 5:56:47 AM2/21/21
to Er Mo, mementodatabase
Merci Er Mo,

Le script fonctionne, mais je souhaiterais pouvoir traiter les dates dans un format défini....

Mon problème est que dans la fonction que vous proposez, "ort" doit être du format "xxx" (nom d'un champ), si je défini une variable pour "ort", ce ne fonctionne pas...


function LS(ort)
{
var ort1 = ort
var entries = lib().entries(ort1);
var entry = entries[0];
var l = entries.length;
if(l>0)
{
var res = entries[0].field(ort1);
return res;
}
}
// Aufruf
var e=entry()
var d1 = e.field("Date")
var dx = moment(d1).format("DD/MM/YYYY")

e.set("Date3",LS("Date"))
// si je mets une variable (dx par exemple) à la place de "Date", cela ne fonctionne plus...

Merci...

Danke Er Mo,

Das Skript funktioniert, aber ich wünschte, ich könnte die Daten in einem definierten Format verarbeiten...

Mein Problem ist, dass in der von Ihnen entwickelten Funktion "ort" das Format "xxx" (Name eines Feldes) haben muss. Wenn ich eine Variable für "ort" setze, funktioniert dies nicht...

function LS(ort)
{
var ort1 = ort
var entries = lib().entries(ort1);
var entry = entries[0];
var l = entries.length;
if(l>0)
{
var res = entries[0].field(ort1);
return res;
}
}
// Aufruf
var e=entry()
var d1 = e.field("Date")
var dx = moment(d1).format("DD/MM/YYYY")

e.set("Date3",LS("Date"))
// Wenn ich eine Variable (zum Beispiel dx) anstelle von "Date" setze, funktioniert das nicht mehr...

Danke...

Gilles Mons

unread,
Feb 21, 2021, 6:16:28 AM2/21/21
to Er Mo, mementodatabase
Merci Er Mo,

Grâce à votre fonction j'ai trouvé, en fait il ne faut pas que je passe par une fonction voici le script:

Danke Er Mo,

Dank Ihrer Funktion, die ich gefunden habe, darf ich hier eigentlich keine Funktion durchlaufen, ist das Skript:

var e = entry()
var entries = lib().entries("Date");
var entry = entries[0];
var l = entries.length;
if(l>0)
{
var res = entries[0].field("Date");
var res2 = moment(res).format("DD/MM/YYYY");
e.set("Date3",res2);
}

Merci beaucoup pour m'avoir débloquer....

Vielen Dank, dass Sie mich entsperrt haben ....

Gilles Mons

unread,
Feb 21, 2021, 10:04:08 AM2/21/21
to Er Mo, mementodatabase
voici une table exemple, créer grace au script de Er Mo

elle montre par l'exemple 2 choses:

1- un agrégats par date.

( Date formaté DD/MM/YY)
cela permet de faire un compteur d'heures par date.
pour un compteur de temps d'interventions par exemple.
cela évite de passer par les tri ou regroupement)

2- la récupération de la valeur d'un champ dans l'enregistrement précédent.

cela permet de faire une auto-incrémentation par exemple.


Here is an example table, created with the Er Mo script it shows by example 2 things:

1- an aggregate by date.
(Date formatted DD / MM / YY)

this makes it possible to make an hour counter by date.
for an intervention time counter for example.
this avoids going through sorting or grouping)

2- retrieving the value of a field in the previous record.

this allows an auto-incrementation for example.


Hier ist eine Beispieltabelle, die mit dem Er Mo-Skript erstellt wurde es zeigt anhand von Beispiel 2 Dinge:

1- ein Aggregat nach Datum. (Datumsformatiert TT / MM / JJ)
Dies ermöglicht es, einen Stundenzähler nach Datum zu erstellen. zum Beispiel für einen Interventionszeitzähler.

Dies vermeidet das Sortieren oder Gruppieren.

2- Abrufen des Werts eines Feldes im vorherigen Datensatz.

Auf diese Weise können Sie beispielsweise eine automatische Inkrementierung durchführen.

Aggregation 1 field by same date & Retrieving the value of a field from the previous record

Gilles Mons

unread,
Feb 25, 2021, 2:18:22 PM2/25/21
to Er Mo, mementodatabase
Bonjour Er Mo,

J'ai un problème, je n'arrive pas à créer une boucle dans votre fonction....

Je souhaite parcourir tout les enregistrements de la librairie, et cela ne fonctionne pas....

Je vous partage le script et la base...

Pourriez vous m'aider....

Merci,

Hallo Er Mo,

Ich habe ein Problem, ich kann keine Schleife in Ihrer Funktion erstellen... 

Ich möchte alle Aufnahmen in der Bibliothek durchsuchen, und es funktioniert nicht ....

Ich teile das Skript und die Basis mit Ihnen...
Kannst du mir helfen... 

Danke,


function LS(ort)
{

var entries = lib().entries(ort);
var l = entries.length;
for (var i=0;i<l;i++)
{
var entry = entries[i];
var res = entries[i].field(ort);
return res;
}
};

var e=entry(),
e1 = LS("essai1"),
D = e.field("Date"),
D1 = LS("Date"),
x1 = moment(D).format("DD-MM-YY"),
x2 = moment(D1).format("DD-MM-YY"),
c = e.field("Coche"),
c1 = LS("Coche"),
xx = (x2 == x1);


if (x2 === x1)
{
e.set("essai2",e1);

e.set("date2"," ok");
};



Er Mo

unread,
Feb 25, 2021, 3:11:49 PM2/25/21
to mementodatabase
Hallo Gilles
Glaube das Problem ist die " Funktion () " . Sie kann nur eine Wert zurück geben . Mit den Befehl " return " wird die Funktion beendet und der Wert übergeben . Die Schleife wird nicht mehr durchlaufen . Wenn du etwas Suchst muss du das in der Funktion machen und das Ergebnis zurück geben . Funktionen eignen sich gut für Sachen die ein Ergebnis haben und oft verwendet werten . Zb Du hast eine Berechnung für den Endpreis einer Sache . Du übergibst der Funktion den Einkaufspreis und erhaltes den Verkaufspreis . Die Funktion rechnet , holt Daten von Bibliotheken und gibt dir das Ergebnis aus . So brauchs du nur eine Befehl eingeben um das Ergebnis zu erhalten . Du kannst die Funktion auch in Internet ablegen und jeder Bibliothek zugänglich machen . Auch ist eine Änderung in der Funktion , in Allen Bibliotheken wirksam ( nach den Aktualisiren ) .


Bonjour Gilles
Croyez que le problème est la "fonction ()". Il ne peut renvoyer qu'une seule valeur. La commande "return" termine la fonction et transfère la valeur. La boucle n'est plus exécutée. Si vous cherchez quelque chose, vous devez le faire dans la fonction et renvoyer le résultat. Les fonctions sont bonnes pour les choses qui ont un résultat et sont souvent utilisées. Par exemple, vous avez un calcul pour le prix final d'une chose. Vous remettez le prix d'achat à la fonction et recevez le prix de vente. La fonction calcule, récupère les données des bibliothèques et vous donne le résultat. Il vous suffit donc de saisir une seule commande pour obtenir le résultat. Vous pouvez également mettre la fonction sur Internet et la rendre accessible à n'importe quelle bibliothèque. Une modification de la fonction est également effective dans toutes les bibliothèques (après les mises à jour).

Gilles Mons

unread,
Feb 25, 2021, 10:48:47 PM2/25/21
to Er Mo, mementodatabase
Merci pour c'est explications très claires..

Vielen Dank für die sehr klaren Erklärungen.

Gilles Mons

unread,
Feb 27, 2021, 2:47:27 AM2/27/21
to Er Mo, mementodatabase
Bonjour Er Mo,
Grâce à vous et un peu voir beaucoup de grattage de tête j'ai réussi à faire ce que je souhaitais je vous ai partagé la base test merci encore pour l'invitation et votre fonction...


Hallo Er Mo,

Dank dir und als ich sah, dass ich mich am Kopf kratzte, schaffte ich es zu tun, was ich wollte. Ich teilte dir die Testbasis mit. Nochmals vielen Dank für die Einladung und deine Funktion ...
Reply all
Reply to author
Forward
0 new messages