Jump to content

Isn't Windows new line 0x0a0d?


Recommended Posts

I know that it's 0x0d0a as you go through the file, and has to be written as WRITE_SHORT 0x0a0d; that's not my question ???

 

I just think that would be better expressed as %0xd%%0xa% than a separate variable - since WeiDU doesn't decompile with windows breaks, it hardly matters anyway.

 

/edited to add:

 

I'm mentioning this not because it's fun to gripe about nothing, but because I like avoiding this kind of behavior:

COPY_EXISTING ~stats.ids~ ~override~
 PATCH_IF (1) THEN BEGIN
SET "0x0d_count" = 0
SET "0x0a_count" = 0
FOR ("i" = 0x0; "i" < SOURCE_SIZE; "i" += 0x1) BEGIN
  READ_BYTE "i" "var"
  PATCH_IF ("var" = 0xa) THEN BEGIN
	READ_ASCII "i" ~0x0a_var~ (0x1)
	SET "0x0a_count" += 0x1
  END ELSE PATCH_IF ("var" = 0xd) THEN BEGIN
	READ_ASCII "i" ~0x0d_var~ (0x1)
	SET "0x0d_count" += 0x1
  END
END
PATCH_PRINT ~Count via loop:  0x0a count: %0x0a_count%;  0x0d count: %0x0d_count%~
COUNT_REGEXP_INSTANCES ~%0x0a_var%~ ~0x0a_count~
COUNT_REGEXP_INSTANCES ~%0x0d_var%~ ~0x0d_count~
PATCH_PRINT ~Count via regexp: 0x0a count: %0x0a_count%;  0x0d count: %0x0d_count%~
 END
BUT_ONLY

 

where COUNT_REGEXP_INSTANCES reports 166 0xd and there's actually 167. Again, I'm not asking for advice on how to work around it :(

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...