Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 4 Jahren, 12 Monaten
Letzter Beitrag:
vor 4 Jahren, 12 Monaten
Beteiligte Autoren:
GC, DerekT, Ruben Sanchez Peña, ICI, Fabrice Harari

Field Name Change For Runtime

Startbeitrag von GC am 26.07.2013 13:30

hi....

I have create tamp table in windev17
but problem create temp table not access runtime all data file in for loop,,

and

runtime field name not change
table name is=Precent
fieldname is=SMA_1,SMA_2,SMA_3,SMA_4,SMA_5,......

i am code write for this
--------------
i is int
for i=1 _to_ 5
Precent.SMA_+i=1
hadd(Precent)
end

Antworten:

Hi GC

this is your second question in so many days, and I must say that I was not able to understand any of them...

I do not know what your native language is, and I applaud your attemps at asking questions in English, but I suggest that you ALSO write your question in your native language below the english version... Maybe there will be somebody who speaks your language and will be able to answer you because of that...

Hope this will get you more answers :-(

Best regards

von Fabrice Harari - am 26.07.2013 14:30
Indirection is your friend - check it in the Help


i is int
FOR i = 1 _TO_ 5
{"Precent.SMA_" + i,indFile} = 1
HAdd(Precent)
END


von DerekT - am 26.07.2013 15:41
Hi GC

I also try to decrypt your question, like Fabrice, but if I correct think then:

for i=1 to 5
{"Precent.SMA_"+i}=1
HAdd(Precent)
end

P.S. I see Derek was faster 6 secs then me so I can append this.
This function work also without indFile and off course with that.

von ICI - am 26.07.2013 15:47
ICI
Whilst you are correct that is is not necessary to include type constant doing so will optimise the performance of indirection.

In the case here using 'indFile' will cause WD to immediately look in the analysis for the target element.
Without this it will search - the order of search is not documented but one could assume that it will check local window variables, global window variables, global application variables and so on until it finds the required element to convert.

More importantly if say you have a loop 1 to 50 then without the type it will perform the search for each and every iteration.
With the type declared it will use the information gained on the first iteration on all subsequent conversions.

von DerekT - am 26.07.2013 22:07
Thnax all friend......

von GC - am 27.07.2013 05:03
Hi. Well, if he want put values in all the record fields then the code must be:

i is int
FOR i = 1 _TO_ 5
{"Precent.SMA_" + i,indFile} = 1

END

HAdd(Precent)


Rubén

von Ruben Sanchez Peña - am 27.07.2013 09:44
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.