The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
IFTE function cmd and store cmd
11-12-2018, 05:57 PM (This post was last modified: 11-12-2018 06:58 PM by compsystems.)
Post: #1
IFTE function cmd and store cmd
Hello,
I want to extract the "TRUE" values from an array
[ false, false, true, true ] => [ true, true ]

In the following code there is a problem when trying to store a variable within IFTE function cmd
if I delete y: = or ▶y it works but the value of y is not updated

PHP Code:
#cas
test_IFTE( ):=
begin
  local x
yz;
  
:= 1
  
:= []; 
  
:= [ falsefalsetruetrue ];
  
index := 1;
  
REPEAT 
    ifte
z[x] == true,  concatytrue )▶ynop ); 
    
x++; 
  
until 
    x 
== 5;
  
  return 
y;
 
end;
#end 

[Check] No errors in the program

test_IFTE() [Enter] returns
Quote:1,[0,0,true,true,true] ???
[ true, true ] // ok

PHP Code:
iftez[x] == true,  := concatytrue ), nop ); 
// also fails

test_IFTE() [Enter] returns

Quote:"for([0,1,0,{
ifte(((z[x])==true),y:=concat(y,true),'nop');
x++;
IF x = 5 THEN BREAK ; END ;
}]) in [test_IFTE] instruction #7 error, try debug([test_IFTE])
Error: Bad Argument Value"


REQUEST: An alternative or simpler code with functions cmd and not block of structures?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
IFTE function cmd and store cmd - compsystems - 11-12-2018 05:57 PM



User(s) browsing this thread: 1 Guest(s)