Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 10-16-2009, 06:41 AM   #1

Join Date: Oct 2007
Location: Pesaro
Posts: 25
Ignore this user

Thanks: 2
Thanked 5 Times in 5 Posts

Need Help to Retrieve a String Using ADE or ELCollections

Hi,
I'm not familiar with ADE and ELCollections so I ask an Help to You.

I've a txt file with only 2 lines of string:
1st line "my date of birth"
2nd line "16081973"

This file is in the directory C:/temp/date of birth with the name "DATEofBirth.txt"

How can I retrieve the 2 strings in a code/indicator using ADE or ELCollections and Plot them as a string in the chart ???

The only way that I doesn't find is the correct way to get the string in the code, then I know very well the way to plot it in the chart.
Thanks to anyone who gives me an help

CrazyNasdaq
Crazynasdaq is offline  
Reply With Quote
Old 10-16-2009, 09:36 AM   #2

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,474 Times in 912 Posts

Re: Need Help to Retrieve a String Using ADE or ELCollections

there is no better way than to read the instructions...

if I tell you how, my words will pretty well be a repeat of the manual.

http://www.traderslaboratory.com/for...uage-5934.html
__________________



Only an idiot would reply to a stupid post
Tams is offline  
Reply With Quote
Old 10-16-2009, 12:56 PM   #3

Join Date: Oct 2007
Location: Pesaro
Posts: 25
Ignore this user

Thanks: 2
Thanked 5 Times in 5 Posts

Re: Need Help to Retrieve a String Using ADE or ELCollections

Quote:
Originally Posted by Tams »
there is no better way than to read the instructions...

if I tell you how, my words will pretty well be a repeat of the manual.

http://www.traderslaboratory.com/for...uage-5934.html
Hi TMAS and thanks for the link.
I've tried to code myself, but with no result.
Here is the actual situation and the code that I've tried.


The string to retrieve is more simple than the first one, only a long number in 1 row and 1 column:

4409929648741489700

always in a directory with a txt file.
I've tried the string "ELC.PathExists(FileN ame) " and it gives me back the proof of the existance of the txt file, but the complete code gives me back nothing........

[code]
************************* ***
Inputs: FileName("ctemp\Autoriz ation_code.txt");

Vars: DataMap(ListN.New),
code(0),
x(0);


if CurrentBar > 1 then begin
if ELC.PathExists(FileName) then begin
value1 = ListN.ReadFile(DataMap, FileName);

// Check map count in case file was empty
if ListN.Count(DataMap) > 1 then begin
code = ListN.Get(DataMap,1);
end;


value3 = ListN.Get(code, 1);


X = text_new(d,t,c[1],"");

If lastbaronchart then
Text_setstring(x, numtostr(value3,0));
end
else print ("File does not exist");
end;

************************* *******

I don't know how to get that code.
Where I'm wrong ???

Thanks
Crazynasdaq is offline  
Reply With Quote
Old 01-26-2012, 11:02 PM   #4

Join Date: Jan 2012
Posts: 1
Ignore this user

Thanks: 1
Thanked 0 Times in 0 Posts

Re: Need Help to Retrieve a String Using ADE or ELCollections

Based on your code :

Code:
Inputs: FileName ( "C:\ADE\Data\My_Brain.txt" );// File location

Vars: DataMap(ListN.New)                        ,// Create List of numeric values named "Datamap"
      Ergebnis (0)                              ,// Variable for the content || result
      Counter(0)                                ;// just to count up

Counter = Counter+1 				      ;// Barcounter one up (for debugg only)
      
if CurrentBar > 1 then begin                     // all bars in chart but the current
   if ELC.PathExists(FileName) then begin        // in case file is found
        value1 = ListN.ReadFile(DataMap, FileName);// read file into list "DataMap"
        Ergebnis = ListN.Get(DataMap,1)           ;// pick first data in list and make it Ergebnis
        Print (Counter, " Gefunden = ",Ergebnis);// print it for debugging only
      end                                        //
   else                                          //
      print ( Counter , "Kein File vorhanden")  ;// File not found
   end                                          ;//
value1 = ListN.Clear(DataMap)                   ;// Clear List and free memory
The bug you have is in

Code:
value3 = ListN.Get(code, 1);
The variable "code" is no list but a variable as you declared it => NumericSimple

Lobo
Lobo.Trader is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
Elcollections.dll Sources Needed radekj Coding Forum 6 10-22-2011 09:04 AM
ELCollections.dll giladbi Coding Forum 9 04-14-2011 01:23 AM

All times are GMT -4. The time now is 02:03 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.