Post reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.
Name:
Email:
Subject:
Message icon:

Verification:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?:

shortcuts: hit alt+s to submit/post or alt+p to preview


Topic Summary

Posted by: K4thos
« on: August 25, 2015, 09:33:12 AM »

As title suggest weidu can't read text from the end of file via READ_2DA_ENTRY if the file is very large. You can test it with this TRA file (TLK converted to TRA):
https://www.sendspace.com/file/fmxmbs

and this test code:
Code: [Select]
COPY - ~bg2ee_ENG.tra~ ~bg2ee_ENG.tra~
COUNT_2DA_ROWS 3 "cnt_row"
READ_2DA_ENTRY cnt_row 0 3 "cutoff"
PATCH_PRINT ~cutoff = %cutoff%, cnt_row = %cnt_row%~
I'm currently using workaround for this problem, so it's not really very important to me, but I'm wondering if the file size limit for this command is a bug or limitation that can't be bypassed. It the latter than is it known what is the exact size limit?

edit: unless I've made a mistake in above test code something is weird. I've just tried this test code on the same file and this time weidu was able to print the last string correctly:
Code: [Select]
COPY - ~bg2ee_ENG.tra~ ~bg2ee_ENG.tra~
SPRINT cutoff ~dummy~
COUNT_2DA_ROWS 3 "cnt_row"
WHILE (~%cutoff%~ STRING_CONTAINS_REGEXP ~^@[0-9]+~) BEGIN //not StrRef
READ_2DA_ENTRY cnt_row 0 3 "cutoff"
SET cnt_row = cnt_row - 1
END
PATCH_PRINT ~cutoff = %cutoff%, cnt_row = %cnt_row%~

edit2: yep, the first test code was faulty. This one works:
Code: [Select]
COPY - ~bg2ee_ENG.tra~ ~bg2ee_ENG.tra~
COUNT_2DA_ROWS 3 "cnt_row"
READ_2DA_ENTRY (cnt_row - 1) 0 3 "cutoff"
PATCH_PRINT ~cutoff = %cutoff%, cnt_row = %cnt_row%~
Not sure why weidu could read that last empty line without error though.