I'm trying to convert a macro from Far2 to the new Far3 Lua.
What is "panel.setpos" in Lua? I need to jump to a file based on it's name in the panel.
And is "luafar_manual.chm" the only English documentation available?
Edit: Is the old Macro commands still available in Far3? as all documentation (including F1) seems to show the old commands, but nowhere can I find how I would use them.
jonib
Solved: What is panel.setpos in LUA?
-
- Posts: 6836
- Joined: Thu 23 Mar, 2006 21:36
- Location: Israel
- Has thanked: 41 times
- Been thanked: 530 times
Re: What is panel.setpos in LUA?
jonib
Lua is case sensitive language. Hence, it is Panel.SetPos, exactly as spelled in the manual.
The manual currently has no English translation.
You can export your Far 2 macros from the registry and send me via personal message. I have a (not finished but functional) utility for automatic conversion to Far 3 format.
Lua is case sensitive language. Hence, it is Panel.SetPos, exactly as spelled in the manual.
The manual currently has no English translation.
You can export your Far 2 macros from the registry and send me via personal message. I have a (not finished but functional) utility for automatic conversion to Far 3 format.
Re: What is panel.setpos in LUA?
Thanks for the quick reply.
What manual are you referring to?
Edit: I think I got Panel.SetPos figured out. Let's see what creates problems next.
Edit2: Looks like I got the macro converted, so I'm fine for now. Hopefully I can avoid any more roadblocks.
jonib
Problem is I haven't found any syntax in any manual. I found one reference in "macroapi_manual.chm" but that don't actually show how to use it.Shmuel wrote:Lua is case sensitive language. Hence, it is Panel.SetPos, exactly as spelled in the manual.
The manual currently has no English translation.
What manual are you referring to?
Edit: I think I got Panel.SetPos figured out. Let's see what creates problems next.
Thanks for the offer, I'll put in the macro I'm working on. Rest of my macros I want to convert myself. It's kinda hard to learn this new Lua stuff if your tool does all the work.You can export your Far 2 macros from the registry and send me via personal message. I have a (not finished but functional) utility for automatic conversion to Far 3 format.
Code: Select all
Macro:Post mmode(1,0) $If (APanel.Selected) %index=1; $Rep (APanel.ItemCount) $If (panelitem(0,%index,8)) $If (%list) %list=%list+panelitem(0,%index,0)+"|"; $Else %list=panelitem(0,%index,0)+"|"; $End $End %index=%index+1; $End ShiftSubtract $While (%List) $If (panel.setpos(0,substr(%List,0,index(%List,"|")))) $Else msgbox("Error", "File: "+substr(%List,0,index(%List,"|"))+" gone!") $Exit $End %List=substr(%List,index(%List,"|")+1); ShiftF1 Enter Home $Text PPanel.Path \ Enter $End $Else ShiftF1 Enter Home $Text PPanel.Path \ Enter $End
jonib
Re: What is panel.setpos in LUA?
OK, I guess many of the functions have the same syntax as the old macro language, so I'll try that next time.Shmuel wrote:macroapi_manual.chm
Thanks, but mines nicer.Here is your macro converted.
Jupp, I prefer to convert manually as the code is kinda horrible with a direct conversion.
jonib