Categories > Coding > C# >

Execute script form tabs


New Reply

TJB13022012

JustSomeGuyThatsHere

Posts: 11

Threads: 3

Joined: Jul, 2022

Reputation: 0

  • 1

Posted

So if i select the current tab with the avalon text editor (im going to add monaco) and i have some code: WeAreDevsLibrary.SendLuaScript(text);

 

            TabItem selectedTab = tabDynamic.SelectedItem as TabItem;

            TextEditor textEditor = selectedTab.Content as TextEditor;

 

            string text = textEditor.Text;

 

The code of wearedevslibrary.sendluascript(text) then the local variable  gives a error this is the error (cannot use local variable before it is declared) Can someone help me out?

Hello there.

Posts: 474

Threads: 23

Joined: Nov, 2022

Reputation: 28

  • 0

Replied

put 

WeAreDevsLibrary.SendLuaScript(text);

after you declare text

!!!!!marcus__!!!!!#8611

https://cdn.discordapp.com/attachments/1066053366758780978/1078052772567597127/image.png

TJB13022012

JustSomeGuyThatsHere

Mention

Posts: 11

Threads: 3

Joined: Jul, 2022

Reputation: 0

  • 0

Replied

so you mean text = WeAreDevsLibrary.SendLuaScript(); you mean that?

Hello there.

Posts: 474

Threads: 23

Joined: Nov, 2022

Reputation: 28

  • 0

Replied

@TJB13022012

no lmao


 

            TabItem selectedTab = tabDynamic.SelectedItem as TabItem;

            TextEditor textEditor = selectedTab.Content as TextEditor;

 

            string text = textEditor.Text;

 WeAreDevsLibrary.SendLuaScript(text);

!!!!!marcus__!!!!!#8611

https://cdn.discordapp.com/attachments/1066053366758780978/1078052772567597127/image.png

TJB13022012

JustSomeGuyThatsHere

Mention

Posts: 11

Threads: 3

Joined: Jul, 2022

Reputation: 0

  • 0

Replied

I haven't been coding a long time ago. So declare it before or whatever i forgot alot of things.

 

Hello there.


New Reply

Users viewing this thread:


( Members: 0, Guests: 1, Total: 1 )