Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Continuation section too long.



  • Please log in to reply
10 replies to this topic
CodeEater
  • Members
  • 83 posts
  • Last active: Jun 06 2013 03:42 PM
  • Joined: 17 Jun 2012

Hello,

I'd like to keep my data in a variable so that when i compile my script, it will be hidden from other.

 

However, my data is too long and i got the error message: "Continuation section too long."

 

And the question is: how could i assign large string to a variable without using FileRead?

 

Thanks for any help!

 



noname
  • Members
  • 650 posts
  • Last active:
  • Joined: 12 Nov 2011

 

 

A continuation section cannot produce a line whose total length is greater than 16,383 characters (if it tries, the program will alert you the moment the script is launched). One way to work around this is to do a series of concatenations into a variable.

 

 

If you look in the helpfile http://www.autohotke...tm#continuation you will find a workaround using multiple sections.

If you search the forum Skan has made a program that can compress the data maybe this will be enough to get within the limitation.

 

 

You can take a long at the code here:

http://www.autohotke...t-exezipdlletc/

 

It uses a similar concept to store its variable with the data in chunks to overcome the limitation.

 

 


winXP  and ahk unicode


CodeEater
  • Members
  • 83 posts
  • Last active: Jun 06 2013 03:42 PM
  • Joined: 17 Jun 2012

thanks for your reply. And i've also searched before asking.

However, my string data is too long (about 15000 lines) and that why using the suggestion in the helpfile is not a good idea.

SKAN 's Script  requires a variable holding the data but that is the only thing i need.

And the Rseding91 's Script need to extract data to the harddisk again. If only Rseding91 created a function that extract the data directly to the variable :)



Rijul Ahuja
  • Members
  • 763 posts
  • Last active: Nov 25 2013 10:16 AM
  • Joined: 14 Mar 2012

You might have thought of this, but couldn't you extract the data using Rseding's script to a random location (like A_Temp), fileread and quickly delete?

Or you can study up on the working of the extract function, and use it to your advantage?


Abandon the forum. The community has decided in a democratic vote to leave this website because of inactive and perverse administration.

Very few of the contributing members remain here.


CodeEater
  • Members
  • 83 posts
  • Last active: Jun 06 2013 03:42 PM
  • Joined: 17 Jun 2012

Thanks for your suggestion, Rijul Ahuja.

Extracting the string data to somewhere is the final way if no solution else can be found.

Rseding used many API calls which out of my knowledge.



Rijul Ahuja
  • Members
  • 763 posts
  • Last active: Nov 25 2013 10:16 AM
  • Joined: 14 Mar 2012

Perhaps ask him, he is a helpful guy.


Abandon the forum. The community has decided in a democratic vote to leave this website because of inactive and perverse administration.

Very few of the contributing members remain here.


Eedis
  • Members
  • 1775 posts
  • Last active: Aug 14 2015 06:33 PM
  • Joined: 12 Jun 2009

Why can't you store the data in a .dat file and encrypt it? Then when the program FileRead's it, simply decrypt it internally in the script.

 

This may help if you rewrite the code a little:

Encoding/Decoding highlighted text in a notepad GUI -- By Laszlo


AutoHotkey state, the forum, Poly, and Drainx1. The short story.
I love my wife, my life, my atomic-match; for giving me the greatest gift a man could ask for, such a perfect and beautiful little girl.
9rjbjc.png

noname
  • Members
  • 650 posts
  • Last active:
  • Joined: 12 Nov 2011
✓  Best Answer

It uses a similar concept to store its variable with the data in chunks to overcome the limitation.

 

 

 

This is what i had in mind i had to cutoff part of the data because it is a hex file >6Kb

 

You create a file(or to the clipboard) with chunks <19000 characters then paste them into your code and recombine them when you need the var.

 

Rseding91 used some clever code that i failed to understand but i could do it like this.

 

reading a test  file into var

cutting it in 1000 char parts

pasting it in the code again

recombining it

 

it is a picture and i could get the picture from the recombined code so it works.

FileRead, t,test.hex


var := RegExReplace(t,".{1,1000}","$0`n")
	
loop,parse,var,`n
fileappend,a%A_Index%=%A_LoopField%`n ,data.txt
	
msgbox ok

;this is the pasted code from step 1 data.txt

a1=89504E470D0A1A0A0000000D494844520000001F00000028080600000006D1212  ;this data is cutoff!!
a2=70F87E3C3C45A190B9D9D9E5E4E4D84AC4425B61CA577DFE67C25FC057FD6CF97
a3=202BC885E49DE4C3E433E41BE421F25B0A9D624071A4F853E22852CA6A4A19E51
a4=B6A8B6B86549B2E45AA659EEB6BC6E855A3959A558555A5DB346AD9DAD25D6BBA
a5=4C0D4CDD9B3A9E169A76206D323D3ABD31839291907142AA214D93B667EA67E66
a6=B95C6BB9EE7ABDB57B66F7E91B9E37CEDDF4BD79F116FFD6D59E393DDDBDF37A6
a7=B89FCCB1F0D306AF033E721F4A9D5B0730684352812F0EA23A496ED9BA2CC88CE9
a8=485A23E93549C5B90CC86559B7A4110385E3E592066380B1D5AF485AEF9EC70547D

loop 8
{
q:=a%A_Index%
var_new .=q
}

winXP  and ahk unicode


CodeEater
  • Members
  • 83 posts
  • Last active: Jun 06 2013 03:42 PM
  • Joined: 17 Jun 2012

Thanks everyone, especially lain,Eedis,Rijui Ahuja!

I got it!



FrostByte
  • Members
  • 148 posts
  • Last active: Sep 16 2015 05:56 PM
  • Joined: 08 Nov 2012

CodeEater, let's consider my code. It reads the hexadecimal data from "DMP.txt", and appends AutoHotkey code to "CODE.txt".

Spoiler


FrostByte and the Artemis Asylrum® Corporation
View my projects: Artemis Media Player

FrostByte62.com is down. I'll find another place to host my stuff soon...after I get done procrastinating some more. :)


gwarble
  • Members
  • 624 posts
  • Last active: Aug 12 2016 07:49 PM
  • Joined: 23 May 2009
Another option would be to add it as a resource when you compile... if you use a packer then it wont be easily viewable even as the original file (like your source, still viewable)

Or you could still convert it to hex and add it as a raw resource and un-hex it like you are now if prefered

I just got this going for a wav resource, though the answer has been on the forum by SKAN for years i didnt realize it, and i'll test out the hex'd data approach

You can even use FileInstall and soon compiler directives to add the resources when compiling so you don't have to use ResHack to add them to your bin manually Edit: but still access the data in memory and not write to disk (ie never execute the FileInstall)