str_trunc and str_clip

Posted By: RedPhoenix

str_trunc and str_clip - 05/29/10 16:52

Both functions are not working in A7.84. They don't change the string in any way. Here is a simple test code that shows the problem:

Code:
#include <acknex.h>
#include <default.c>


TEXT* test_txt = {
	layer = 2;
	pos_x = 300;
	pos_y = 150;
	red = 255;
	green = 255;
	blue = 255;
	font = "Arial#30b";
	strings = 1;
}

var det1 = 0;
var det2 = 0;
var det3 = 0;
function main() {
  video_mode = 6;	 
  video_depth = 32; // 32 bit colour mode
   wait(1); //Load Video device  
   set(test_txt,SHOW);
   wait (3);
   str_cpy((test_txt.pstring)[0],"Ein test!");
   det1 = str_len((test_txt.pstring)[0]);
   wait(-1);
   str_trunc((test_txt.pstring)[0],2);
   wait(1);
   det2 = str_len((test_txt.pstring)[0]);
   wait(-1);
   str_clip((test_txt.pstring)[0],4);
   wait(1);
   det3 = str_len((test_txt.pstring)[0]);
   while(1) {
   DEBUG_VAR(det1,10);
   DEBUG_VAR(det2,50);
   DEBUG_VAR(det3,90);
   wait(1);
   }
}


Posted By: EvilSOB

Re: str_trunc and str_clip - 05/30/10 23:10

Which version? (check full number in the setup.log file)

Works fine for for me with V7.84.2 commercial...
Posted By: jcl

Re: str_trunc and str_clip - 05/31/10 13:51

Both functions are working in 7.84 and 7.85. Possibly not in an interim beta.
Posted By: RedPhoenix

Re: str_trunc and str_clip - 05/31/10 15:27

My version number is 7.85.3 sorry
I forgot about the update because of the multiplayer -cl bug.

EDIT: I downloaded the update from this source:
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=325384&page=1

There it's called A7.854 so I guess you changed that post and the download version after I downloaded it. I will now download the A7.854 version and check whether the problem still exists.

SOLVED: Everything works fine in A7.854.
© 2024 lite-C Forums