Multi Commander > Script

2 functions I'd like to see

<< < (3/3)

Mathias (Author):

--- Quote from: Ulfhednar on February 16, 2015, 17:52:02 ---I seem to have forgotten a lot since I tried using MCscript last!
My concept of vars vs funcs has blurred  :-[ 
Returning to MC script after a long break (+ flu last week) might not have been such a good idea.
Unfortunately I find your script interesting & know just enough to cause you trouble!

--- End quote ---
MultiScript is actually not that strange. MultiScript is actually very similar to most programming languages. like Java,C#, C/C++ , PHP, JavaScript
It uses the same syntax style.  (Kind off)
But If you don't know any if them then I can understand you can have a hardtime understanding it.


--- Quote from: Ulfhednar on February 16, 2015, 17:52:02 ---I see that it is necessary to define some parameters in the @var list, I do not yet know where to divide what is possible & what is correct (as you noticed).

--- End quote ---
The Script engine must know that the variable exists before it can use it, So every variables must first be defined before it can be used.
Variables are just like the X , Y thing you did in maths in school..
Like "10 = 5 + X " then you know that X is 5. So X is a variable that has the value 5.
Same thing here but variables must have a $ before the name. This is just a help for the script engine to know that it is a variable and not something else

Ulfhednar:
I have a small amount of basic & C++ experience - but years ago....& a lot has changed!
So I have to learn/recall again. 

What had thrown me was the fact some vars were defined with = function & some not
eg
@var $arr = GetSourceSelectedPaths();
or
@var $ext;

Until you put the $ext in the loop, it obviously returned a single extension value for multiple different file types.
I since realized that assigning values to vars is conditional on the context.  [Cannot say why I forgot that!! :o]
Returning multiple ext values was dependent on the loop cycling. 
But I can see where both options could be used
- make all exts the same
- keep all exts as is.

I started thinking about the names being the same on multiple files with the same .ext.  Obviously this is made irrelevant by the use of Multi-rename, but I started to think about how to add that to the script as an experiment. 
I started with the idea to only name 1 file & now there is a holocaust of bad code imminent!!  :P

There are quite a lot of interesting possibilities in MC Script & I enjoy playing around with it.  Sorry for the torture it creates.  :)

I will have to look at some programming tutorials, to reduce the time I spend creating comedy scripts for you. ;)

Navigation

[0] Message Index

[*] Previous page

Go to full version