nested context procs do not work [message #1774537] |
Mon, 16 October 2017 21:39 |
Eclipse User |
|
|
|
OK I gve up...
this simple set of procs and test work fine if the procs are inline but fails with
Cannot match given parameters to declared parameters
at val (/testing/testing.test:59)
at test_it (/testing/testing.test:64)
if they are moved to context
here the are
// global [val designerProjectName "Application"]
// global [val projectCountFile [concat [substitute-variables "${system_property:java.io.tmpdir}"] "projectcount.txt"]]
/*
proc set_projectcount2 [val resetflag "NORESET" ]
[val debugflag "NODEBUG" ] {
exec-with-options {
let [val countfile [concat [substitute-variables "${system_property:java.io.tmpdir}"] "projectcount.txt"]] {
if [$debugflag | eq "DEBUG"] {
show-alert [concat "projectcount file:\n\n" $countfile]
}
if [get-file [uri-from-path $countfile] | get exists] {
log "set_projectcount: count file exists"
} -else {
str 1 | write-lines $countfile
}
let [val oldcount [read-lines [uri-from-path $countfile]]] {
if [$debugflag | eq "DEBUG"] {
show-alert [concat "oldcount: " $oldcount]
}
let [val nextcount [$oldcount | plus 1]] {
if [$debugflag | eq "DEBUG"] {
show-alert [concat "nextcount: " $nextcount]
}
if [$resetflag | not-eq "NORESET"] {
str 1 | write-lines $countfile
} -else {
$nextcount | str | write-lines $countfile
}
if [$debugflag | eq "DEBUG"] {
show-alert [concat "Result:\n\n"
+"file: " $countfile "\n\n"
+"oldcount: " $oldcount "\n\n"
+"newcount: " [read-lines [uri-from-path $countfile]]]
}
}
}
}
} -allowStatusDialog
}
proc get_projectlabel2 [val projectname $designerProjectName] {
set_projectcount2
let [val projectcount [read-lines [uri-from-path $projectCountFile]]] {
emit [concat $projectname $projectcount]
}
}
*/
proc test_it {
let [val label [get_projectlabel fred]] {
show-alert $label
}
}
test_it
late-breaking-news
I can run the set_projectcount proc from context but not the get_projectlabel proc
[Updated on: Mon, 16 October 2017 21:51] by Moderator Report message to a moderator
|
|
|
|
Re: nested context procs do not work [message #1774677 is a reply to message #1774569] |
Wed, 18 October 2017 14:31 |
Eclipse User |
|
|
|
Thank you for your response. I see what you are saying, but I have an ecl context before it that sets the variable as a global. By-the-way when applying some ecl contexts that have one of the declared global variables as the default for a parameter I get and error that the variable is not defined, but at run time the script works fine. Strangely in this case the apply works fine but the run-time fails.
this is the context for the testing script:
global_variables
set_projectcount_proc
get_projectlabel_proc
this is the declare in global_variables
global [val designerProjectName "Application"]
[Updated on: Wed, 18 October 2017 14:32] by Moderator Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.08821 seconds