Gamestudio Links
Zorro Links
Newest Posts
FXCM => AVA Trade Plugin???
by Martin_HH. 11/25/26 21:59
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
Removing outliers from files
by jcl. 11/04/26 10:30
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 8,426 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Read data web #474526
10/21/18 16:59
10/21/18 16:59
Joined: Apr 2018
Posts: 37
S
sdelatorre Offline OP
Newbie
sdelatorre  Offline OP
Newbie
S

Joined: Apr 2018
Posts: 37
Hello,

I'm using :

file_append("cot.txt",
http_transfer("http://www.zorro-trader.com/",0),1024);

contentWeb=file_content ("cot.txt");
printf("Webpage %s",contentWeb);

and I Works perfectly but there is a problema because the size of web is bigger than 1024 and when I get the web completely ( without 1024) the file is correct but the Zorro crash.....

Any idea ?
Thanks in advance

Re: Read data web [Re: sdelatorre] #474544
10/22/18 14:01
10/22/18 14:01
Joined: Jul 2000
Posts: 28,149
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,149
Frankfurt
The lines look unsuspicious. Can you post the complete script in a version that crashes?

Re: Read data web [Re: jcl] #474713
10/31/18 15:12
10/31/18 15:12
Joined: Apr 2018
Posts: 37
S
sdelatorre Offline OP
Newbie
sdelatorre  Offline OP
Newbie
S

Joined: Apr 2018
Posts: 37
This is the complete code:


string contentWeb;
string copy="";


function main(){

file_delete("cot.txt"); // delete previous report
file_append("cot.txt",
http_transfer("https://www.zorro.com",0),0);

contentWeb=file_content ("cot.txt");
strcpy(copy,contentWeb);
printf("Content es %s",copy);

printf("nfinished");



}

it crash...........if I change http_transfer("https://www.zorro.com",0),0);
by
http_transfer("https://www.zorro.com",0),1024); -> There is not problem

Re: Read data web [Re: sdelatorre] #474717
10/31/18 17:44
10/31/18 17:44
Joined: Jul 2000
Posts: 28,149
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,149
Frankfurt
Copying a large website into an empty string is no good idea.

Re: Read data web [Re: jcl] #474718
10/31/18 21:35
10/31/18 21:35
Joined: Apr 2018
Posts: 37
S
sdelatorre Offline OP
Newbie
sdelatorre  Offline OP
Newbie
S

Joined: Apr 2018
Posts: 37


OK, but how I can do it easily?

Re: Read data web [Re: sdelatorre] #474719
10/31/18 22:58
10/31/18 22:58
Joined: Feb 2017
Posts: 1,839
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,839
Chicago

Re: Read data web [Re: AndrewAMD] #474869
11/10/18 07:54
11/10/18 07:54
Joined: Apr 2018
Posts: 37
S
sdelatorre Offline OP
Newbie
sdelatorre  Offline OP
Newbie
S

Joined: Apr 2018
Posts: 37
Hello,

I'm copyng into a string in my code, the problem is Zorro crash and it can't read more tan 1024 bytes

Sorry,, but I don't watch the solution

Re: Read data web [Re: sdelatorre] #474871
11/10/18 08:04
11/10/18 08:04
Joined: Jul 2000
Posts: 28,149
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,149
Frankfurt
Of course it crashes. You need a string of sufficient length for copying a website. Define it either as a static char array, or allocate it with mem_alloc. Look into the links by AndrewAMD. And also consider looking in a C book: when you begin to work with arrays and allocations, it's a bit beyond the simple C from the workshops in the manual.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1