ورود

View Full Version : سوال: مشکل در تابع Replace



علیرضا.ا
دوشنبه 30 اردیبهشت 1392, 13:41 عصر
سلام
من یه مشکلی برام پیش اومده
نمیدونستم چی سرچ کنم,اگه تکراریه عذر خواهی میکنم
حالا مشکلم:
من میخوام این کد رو که پایین گزاشتم از یه کد دیگه جدا و حذف کنه(در تابع replace)
ولی برنامه فقط تا اولین گیومه قبول میکنه و بقیه قرمز میشن!
راه حل چیه؟!

<script language="javascript">
function GetBC(lngPostid)
{
intTimeZone=<-BlogTimeZone->;
strBlogId="<-BlogId->";
intCount=-1;
strResult="";
try {
for (i=0;i<BlogComments.length;i+=2)
{
if (BlogComments[i]==lngPostid)
intCount=BlogComments[i+1] ;
}
} catch( e) {
}
if ( intCount==-1) strResult="Archive nazar";
if ( intCount==0) strResult="nazar bede";
if ( intCount>0) strResult=intCount + "nazar" ;

strUrl="http://commenting.blogfa.com/?blogid=" +strBlogId + "&postid=" + lngPostid + "&timezone=" + intTimeZone ;
strResult ="<a href=\"javascript:void(0)\" onclick=\"javascript:window.open('" + strUrl + "','blogfa_comments','status=yes,scrollbars=yes,too lbar=no,menubar=no,location=no ,width=500px,height=500px')\" >" + strResult + " </a>" ;
document.write ( strResult ) ;
}
function OpenLD()
{
window.open('LinkDump.aspx','blogfa_ld','status=ye s,scrollbars=yes,toolbar=no,menubar=no,location=no ,width=500px,height=500px');
return true;
}
</script>

SlowCode
دوشنبه 30 اردیبهشت 1392, 15:08 عصر
سلام
این کد رو داخل یه فایل متنی بریز، بعد فایل متنی رو باز کن و کل محتوا رو بریز تو یه متغیر و بعد replace کن.

open app.path & "\file.txt" for input as #1
strReplace=input(lof(1),1)
Close
text1=replace(text1,strReplace,"")

علیرضا.ا
چهارشنبه 01 خرداد 1392, 16:47 عصر
ممنون

نمیشه این فایل txt به فایل exe پیوست باشه؟

SlowCode
پنج شنبه 02 خرداد 1392, 10:07 صبح
اگه این متن همیشه ثابت باشه میتونی بزاریش تو ریسورس(طرز کارش رو جستجو کن پیدا میکنی)
میتونی تو خود فایل exe هم بنویسی، ولی مورد اولی آسون تره.

علیرضا.ا
پنج شنبه 02 خرداد 1392, 22:07 عصر
پیدا نکردم!

vbhamed
جمعه 03 خرداد 1392, 07:44 صبح
ممنون
نمیشه این فایل txt به فایل exe پیوست باشه؟

سلام
كد اصليت رو در Text1 و كل كد بالا رو داخل يك TextBox با خاصيت MultiLine = True و به اسم مثلا txtScript قرار بده سپس براي تغيير بنويس
text1 = Replace(text1, txtScript, "")