SOFiSTiK Forum

It is currently Thu Sep 19, 2019 4:39 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sat Nov 18, 2017 7:42 am 
Offline

Joined: Fri Jun 07, 2013 3:19 am
Posts: 14
Quote:
LET#A 10 ,22 ,34 ,55 ,76 ,83
LOOP#1 A ! Only the name , #A would be the value 10!
KNOT #1+1 X #A(#1)
ENDLOOP

The above is an example in sofistik user manual, but it doesn't give out the output.

How do I test the above input then? Is it possible to test CADINP input in Teddy?


Top
 Profile  
 
PostPosted: Mon Nov 20, 2017 6:47 am 
Offline

Joined: Tue Mar 30, 2010 5:40 pm
Posts: 180
One general possibility in CADINP (general manual "sofistik basics", section "LET - and STO - Variables"):
"To trace the assignment of values, there is a command DBG#. This will toggle test prints and an interactive debug mode. DBG# uses the variable #0, which
can not be used for other purpose therefore
* DBG#0 No output of intermediate values
* DBG#1 Output of the generated input records
* DBG#2 Additional output of all value assignments
* " and so one

In your example this looks like this:
Code:
dbg#2
LET#A 10 ,22 ,34 ,55 ,76 ,83
LOOP#1 A ! Only the name , #A would be the value 10!
     KNOT #1+1 X #A(#1)
ENDLOOP

For only special values there is another simple thing, the "prt#"-instruction, like:
KNOT #1+1 X #A(#1); prt#A(#1)

And in the manual: "For more comfort one should use TXB / TXE or <TEXT> within literal text."


Top
 Profile  
 
PostPosted: Mon Nov 20, 2017 10:35 am 
Offline

Joined: Fri Jun 07, 2013 3:19 am
Posts: 14
@ragl
Thanks for the detailed explanation.

I think I'd better start from a simple example as below:
Quote:
DBG#2
LET#PI 3.1415
prt#PI

The above input can't be run in teddy since the "execute" button is grayed out.

So I add PROG and End, now it looks like this:
Quote:
+PROG
DBG#2
LET#PI 3.1415
prt#PI
END

But when I run it by clicking "execute" button, the WPS showed an error on me.


Top
 Profile  
 
PostPosted: Mon Nov 20, 2017 10:52 am 
Offline

Joined: Tue Mar 30, 2010 5:40 pm
Posts: 180
CADINP needs a little bit time to master it.

Which prog? Sofistik don't know.

This code
Code:
+prog aqua
head hello
DBG#2
LET#PI 3.1415; prt#PI
end

returns
Code:
   1 +PROG AQUA
         ..
    4 HEAD HELLO
    5 DBG#2
    6 LET#PI 3.1415; PRT#PI
      ---- CADINT VARIABLE PI              (     0) =       3.142
      ---- CADINT VARIABLE PI              (     0) =       3.142
    7 END
      ---- END  = hello


Top
 Profile  
 
PostPosted: Tue Nov 21, 2017 1:41 am 
Offline

Joined: Fri Jun 07, 2013 3:19 am
Posts: 14
I never think the aqua or other modules can be used in this way.

THX!


Top
 Profile  
 
PostPosted: Tue Nov 21, 2017 9:38 am 
Offline

Joined: Wed Dec 10, 2008 1:35 pm
Posts: 78
If you need no specific Sofistik module, then you may use PROG TEMPLATE.

TEMPLATE has no specific commands, but you can use all CADINP commands.

Regards
gmay


Top
 Profile  
 
PostPosted: Wed Nov 22, 2017 2:35 am 
Offline

Joined: Fri Jun 07, 2013 3:19 am
Posts: 14
Looks like the "Template" is the way to go.

THX!


Top
 Profile  
 
PostPosted: Thu Oct 11, 2018 12:28 pm 
Offline

Joined: Thu Oct 11, 2018 11:20 am
Posts: 2
ragl wrote:
CADINP needs a little bit time to master it.

Which prog? Sofistik don't know.

This code
Code:
+prog aqua
head hello
DBG#2
LET#PI 3.1415; prt#PI
end

returns
Code:
   1 +PROG AQUA
         ..
    4 HEAD HELLO
    5 DBG#2
    6 LET#PI 3.1415; PRT#PI
      ---- CADINT VARIABLE PI              (     0) =       3.142
      ---- CADINT VARIABLE PI              (     0) =       3.142
    7 END
      ---- END  = hello


When you say "returns" what do you mean? Where adn to what is it returned?

I have looked in in different places, but I can't find the 'interactive debug mode' that the manual is talking about.

Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group