Sign in to follow this  
Followers 0
MerkurAlex

not sure if this is easy..

10 posts in this topic

it doesnt make sense to me to start doing this anyway i have a program that opens a file and does some changes now i need to check for say #include <GUIConstants.au3> but the part inside these <> could be different after finding that it should change to ex #include "Include\GUIConstants.au3" but this part "Include\HERE" should change to the part inside the <> above i hope that made sense lol


[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

it doesnt make sense to me to start doing this anyway i have a program that opens a file and does some changes now i need to check for say #include <GUIConstants.au3> but the part inside these <> could be different after finding that it should change to ex #include "Include\GUIConstants.au3" but this part "Include\HERE" should change to the part inside the <> above i hope that made sense lol

It really doesn't make much sense the way you wrote, I had to read it a few times to try and get a grasp on it.

I'd probably do something like this if I wanted all the regular includes:

#include <array.au3>
$sScriptRead = @CRLF & FileRead('Script.au3') & @CRLF
$aRegIncludes = StringRegExp($sScriptRead, '(?s)(?i)\n\s*#include\s*\<(.*?)>\s*\r', 3)
_ArrayDisplay($aRegIncludes)
(Providing you are writing your #include statements correctly.) Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

It really doesn't make much sense the way you wrote, I had to read it a few times to try and get a grasp on it.

I'd probably do something like this if I wanted all the regular includes:

#include <array.au3>
$sScriptRead = @CRLF & FileRead('Script.au3') & @CRLF
$aRegIncludes = StringRegExp($sScriptRead, '(?s)(?i)\n\s*#include\s*\<(.*?)>\s*\r', 3)
_ArrayDisplay($aRegIncludes)
(Providing you are writing your #include statements correctly.)
thats kinda what i want i just need to change this #include <whatever.au3> to #include "include\whatever" after finding those i cant think of the right way to do it...

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Share this post


Link to post
Share on other sites

can anyone give me an example on this?


[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Share this post


Link to post
Share on other sites

Why do you need to do:

#include <Include\GuiConstants.au3>

If you have downloaded a script which requires that, copy the include into the Include Directory and then remove the Include\ part. There is no need otherwise for it.

Share this post


Link to post
Share on other sites

Why do you need to do:

#include <Include\GuiConstants.au3>

If you have downloaded a script which requires that, copy the include into the Include Directory and then remove the Include\ part. There is no need otherwise for it.

sigh the way im using this wont work that way and i need "Include\GuiConstants.au3" not with <>

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Share this post


Link to post
Share on other sites

lol you dont get it the code i want works i need to convert THIS

#include <Guiconstants.au3>

BUT guiconstatns.au3 inside <> could be anything

to THIS

#include "include\GuiConstants.au3"

but right #include "include\HERE" should be what was inside the <>


[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Share this post


Link to post
Share on other sites

Nevermind i figured it all out thanks for your help


[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

It's good you found it on your own and that no one helped you to find the answer however simple the question may have seemed. But you should, in the future, post what it is that fixed your issue...

This is how I see what you are wanting:

#include <array.au3>
$hFile = FileOpenDialog('Find AU3', @ScriptDir, 'All AU3 Files (*.au3)')
If @error Then Exit
$sScriptRead = @CRLF & FileRead($hFile) & @CRLF
$aRegIncludes = StringRegExp($sScriptRead, '(?s)(?i)\n\s*#include\s*\<(.*?)>\s*\r', 3)
Dim $aConvert[UBound($aRegIncludes)]
For $iCC = 0 To UBound($aRegIncludes) - 1
    $aConvert[$iCC] = '#include "Include\' & $aRegIncludes[$iCC] & '"'
Next
_ArrayDisplay($aConvert)oÝ÷ ØGb´-¹©eÊ'ÈÁêÞ§Ú¢+b·
.Úk¡¶&Þ²¶§X¤zØb±«­¢+ØÀÌØí¡¥±ô¥±=Á¹¥±½ Ìäí¥¹TÌÌäì°MÉ¥ÁѥȰÌäí±°TÌ¥±Ì ¨¹Ô̤Ìäì¤)%ÉɽÈQ¡¸á¥Ð(ÀÌØíÍMÉ¥ÁÑIô
I1µÀ쥱I ÀÌØí¡¥±¤µÀì
I1(ÀÌØíI%¹±ÕÌôMÑÉ¥¹IáÀ ÀÌØíÍMÉ¥ÁÑI°Ìäì ý̤ ý¤¤ÀäÈí¸ÀäÈį́¥¹±ÕÀäÈį́ÀäÈì±Ðì ¸¨ü¤ÐìÀäÈį́ÀäÈíÈÌäì°Ì¤)¥´ÀÌØí
½¹ÙÉÑmU    ½Õ¹ ÀÌØíI%¹±ÕÌ¥t)½ÈÀÌØí¥
ôÀQ¼U    ½Õ¹ ÀÌØíI%¹±Õ̤´Ä($ÀÌØí
½¹ÙÉÑlÀÌØí¥

tôÌä쥹±ÕÅÕ½Ðí%¹±ÕÀäÈìÀäÈìÌäìµÀìÀÌØíI%¹±ÕÍlÀÌØí¥

tµÀìÌäìÅÕ½ÐìÌäì)9áÐ)½ÈÀÌØí¥
ôÀQ¼U    ½Õ¹ ÀÌØí
½¹ÙÉФ´Ä($ÀÌØíÍMÉ¥ÁÑIôMÑÉ¥¹IáÁIÁ± ÀÌØíÍMÉ¥ÁÑI°Ìäì ý̤ ý¤¤ÀäÈí¸ÀäÈį́¥¹±ÕÀäÈį́ÀäÈì±Ð츨üÐìÀäÈį́ÀäÈíÈÌäì°1µÀìÀÌØí
½¹ÙÉÑlÀÌØí¥

tµÀì
H¤)9áÐ)¥±]ɥѡMÑÉ¥¹QÉ¥µI¥¡Ð ÀÌØí¡¥±°Ì¤µÀìÌäí}%¹±Õ½¹¹ÔÌÌäì°MÑÉ¥¹QÉ¥µ1СMÑÉ¥¹QÉ¥µI¥¡Ð ÀÌØíÍMÉ¥ÁÑI°È¤°È¤¤)M¡±±áÕÑ¡MÑÉ¥¹QÉ¥µI¥¡Ð ÀÌØí¡¥±°Ì¤µÀìÌäí}%¹±Õ½¹¹ÔÌÌäì¤
Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0