Total Commander Forum Index Total Commander
Total Commander
: Total Commander | Totalcmd.net | Ghisler.com | RU.TCKB
 
 RulesRules   SearchSearch   FAQFAQ   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Goto page Previous  1, 2, 3, 4
 
Post new topic   Reply to topic    Total Commander Forum Index -> Total Commander printer-friendly view
View previous topic :: View next topic  
Author Message
AVos002



Joined: 04 May 2010
Posts: 47

Post (Separately) Posted: Sat Jun 05, 2010 00:45    Post subject: Reply with quote

:
================================================================
: C:\Program Files\Total Commander\Plugins\tcwhelp_b10\DemoScripts\Proba.vbs
: %P%N %L
================================================================
Back to top
View user's profile Send private message
Batya



Joined: 15 Dec 2004
Posts: 2218
Location: ,

Post (Separately) Posted: Mon Jun 07, 2010 10:09    Post subject: Reply with quote

AVos002 wrote:
: : 'GetExtensionName'

, , , "GetExtensionName".
:
AVos002 wrote:
C:\Program Files\Total Commander\Plugins\tcwhelp_b10\DemoScripts\Proba.vbs

_________________
, . .
Back to top
View user's profile Send private message
AVos002



Joined: 04 May 2010
Posts: 47

Post (Separately) Posted: Mon Jun 07, 2010 11:32    Post subject: Reply with quote

Batya!
, , .
DOS Windows , :
Code:

'==============================================================
' MS Outlook
'
' :
' { } {- }
'
' TC:
' %P%N %L
'==============================================================
Option Explicit

Dim FSO, MSO, MSG, File, List, F
Set FSO = CreateObject("Scripting.FileSystemObject")
File    = WScript.Arguments(0)
List    = WScript.Arguments(1)

Set MSO = CreateObject("Outlook.Application")
Set MSG = MSO.CreateItem(0)

MSG.Subject = FSO.GetFileName(File) & " [" & GetComment(File) & "]"
MSG.Body    = " !" & vbCrLf & vbCrLf & _
              "---"  & vbCrLf & _
         " , AVos002"

For Each F In Split(FSO.OpenTextFile(List).ReadAll, vbNewLine)
  If F <> "" And FSO.FileExists(F) Then
    MSG.Attachments.Add F
  End If
Next


MSG.Display

Set MSG = Nothing
Set MSO = Nothing
Set FSO = Nothing
WScript.Quit

Function GetComment(pPath)
  Const CommFile = "descript.ion"
  Dim lPath, lName, lText, lComm
  Dim lNameArch
  lPath = FSO.GetParentFolderName(pPath)             '
  lName = FSO.GetFile(pPath).Name                '
  lnameArch=lName
  lName = RusDosWin(lName,0)
  If Instr(lName, " ") > 0 Then lName = """" & lName & """"       ' ,
  If lPath <> "" Then lPath = lPath & "\"             ' ,
  If FSO.FileExists(lPath & CommFile) Then             ' descript.ion ,
    lText = FSO.OpenTextFile(lPath & CommFile).ReadAll          ' () descript.ion
    lComm = Filter(Split(lText, vbNewLine), lName & " ", True, 1)    '
    If UBound(lComm) > - 1 Then                '
      GetComment = Replace(Mid(lComm(0), Len(lName) + 2), "", "")    ' (Mid) (Replace) ""
      GetComment = Trim(Replace(GetComment, "\n", " "))
    Else
      GetComment = ""
    End If
  Else                            ' descript.ion
    GetComment = ""                      '
  End If
  GetComment=RusDosWin(GetComment,1)
End Function

'=========================================================================================================
Function RusDosWin(TextV, CodeV)
'  :
'  CodeV = 0 - DOS Windows
'        = 1 -
'  D - DOS (cp866)
'  W - Windows (cp1251)
'  :
'  ......
'============================================
Const D = "Ũ"
Const W = "񦧨"
'           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
' ============================================
If CodeV = 0 Then
      RusDosWin = SymChange(TextV, W, D)
    Else
      RusDosWin = SymChange(TextV, D, W)
End If
'RusDosWin = D
End Function

Function SymChange(TextVal, NewCode, OldCode)
'    OldCode -> NewCode:
'  TextVal OldCode NewCode$
'  ! :  LEN(NewCode)=LEN(OldCode)
Dim Sym, PromText
Dim Ltext
Dim i, k
Sym = "" ' TextVal
Ltext = Len(TextVal)
If Ltext > 0 Then
    For i = 1 To Ltext
        PromText = Mid(TextVal, i, 1)             '
        If Asc(PromText) > 126 Then               ' 126 (.. )
       k = InStr(OldCode, PromText)           ' OldCode
            If k > 0 Then                         ', 0 (.. )
           Sym = Sym & Mid(NewCode, k, 1)          ', NewCode
       Else                   ' OldCode ,
      MsgBox " " & PromText & " "   '
       end if   
        Else                     ' 126
            Sym = Sym & PromText            '
        End If
    Next
End If
SymChange = Sym
End Function

?
Back to top
View user's profile Send private message
AVos002



Joined: 04 May 2010
Posts: 47

Post (Separately) Posted: Mon Jun 07, 2010 11:53    Post subject: Reply with quote

Batya wrote:
:
AVos002 wrote:
C:\Program Files\Total Commander\Plugins\tcwhelp_b10\DemoScripts\Proba.vbs

Proba.vbs
Back to top
View user's profile Send private message
Batya



Joined: 15 Dec 2004
Posts: 2218
Location: ,

Post (Separately) Posted: Mon Jun 07, 2010 13:40    Post subject: Reply with quote

AVos002 wrote:
Proba.vbs

?
_________________
, . .
Back to top
View user's profile Send private message
AVos002



Joined: 04 May 2010
Posts: 47

Post (Separately) Posted: Mon Jun 07, 2010 13:52    Post subject: Reply with quote

, , .
.. ?
Back to top
View user's profile Send private message
Batya



Joined: 15 Dec 2004
Posts: 2218
Location: ,

Post (Separately) Posted: Mon Jun 07, 2010 16:41    Post subject: Reply with quote

AVos002 wrote:
, , .

? "C:\Program Files\Total Commander\Plugins\tcwhelp_b10\DemoScripts\Proba.vbs", . .

AVos002 wrote:
.. ?

, Wink
. .
Code:
' OEM-866 Win-1251
Function Dos2Win(pDosString)
  Dim i, lStr
  If Len(pDosString) = 0 Then Exit Function
  For i = 1 To Len(pDosString)
    lStr = Asc(Mid(pDosString, i, 1))
    If     lStr >= 128 And lStr <= 175 Then
                                           Dos2Win = Dos2Win & Chr(lStr + 64)
    ElseIf lStr >= 224 And lStr <= 239 Then
                                           Dos2Win = Dos2Win & Chr(lStr + 16)
    ElseIf lStr  = 240                 Then
                                           Dos2Win = Dos2Win & Chr(168)
    ElseIf lStr  = 241                 Then
                                           Dos2Win = Dos2Win & Chr(184)
    ElseIf lStr  = 255                 Then
                                           Dos2Win = Dos2Win & Chr(160)
    Else
                                           Dos2Win = Dos2Win & Chr(lStr)
    End If
  Next
End Function

Code:
Set FSO = CreateObject("Scripting.FilesystemObject")
MsgBox StrConv(FSO.OpenTextFile("dos.txt").ReadAll, "ibm866", "windows-1251")

Function StrConv(Text, SourceCharset, DestCharset)
  With CreateObject("ADODB.Stream")
    .Type = 2
    .Mode = 3
    .Open
    .Charset  = DestCharset
    .WriteText Text
    .Position = 0
    .Charset  = SourceCharset
    StrConv   = .ReadText
  End With
End Function

_________________
, . .
Back to top
View user's profile Send private message
MVV



Joined: 15 Oct 2009
Posts: 4811
Location: -

Post (Separately) Posted: Mon Jun 07, 2010 17:07    Post subject: Reply with quote

- , , ( 128) , . , , , ( ). 128 , - 128 255 866 1251 - !
Code:
---+---L+T+-+LT=+TTLL-++-----v
( 866->1251, EmEditor; - )
Code:
??'?":?%?<?????''""--?T?>??????c<-R+???>???˜-
( 1251->866, EmEditor; - , , )

, s[i] table[(s[i])-128] ( , s[i]<128) - . .
_________________
TCFS2 + TCFS2Tools: ()
WINCMD.RU: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel
Back to top
View user's profile Send private message
AVos002



Joined: 04 May 2010
Posts: 47

Post (Separately) Posted: Mon Jun 07, 2010 18:10    Post subject: Reply with quote

MVV, VBScript.
Back to top
View user's profile Send private message
AVos002



Joined: 04 May 2010
Posts: 47

Post (Separately) Posted: Wed Jun 09, 2010 22:54    Post subject: Reply with quote

Batya, , .
Batya wrote:
? "C:\Program Files\Total Commander\Plugins\tcwhelp_b10\DemoScripts\Proba.vbs", . .

Code:
'==============================================================
' MS Outlook
'
' :
' { } {- }
'
' TC:
' %P%N %L
'==============================================================
Option Explicit

Dim FSO, MSO, MSG, File, List, F
Set FSO = CreateObject("Scripting.FileSystemObject")
File    = WScript.Arguments(0)
List    = WScript.Arguments(1)

Set MSO = CreateObject("Outlook.Application")
Set MSG = MSO.CreateItem(0)

MSG.Subject = FSO.GetFileName(File) & " [" & GetComment(File) & "]"
MSG.Body    = " !" & vbCrLf & vbCrLf & _
              "---"  & vbCrLf & _
         " , AVos002"

For Each F In Split(FSO.OpenTextFile(List).ReadAll, vbNewLine)
  If F <> "" And FSO.FileExists(F) Then
    MSG.Attachments.Add F
  End If
Next


MSG.Display

Set MSG = Nothing
Set MSO = Nothing
Set FSO = Nothing
WScript.Quit

Function GetComment(pPath)
  Const CommFile = "descript.ion"
  Dim lPath, lName, lText, lComm
  Dim lNameArch
  lPath = FSO.GetParentFolderName(pPath)             '
  lName = FSO.GetFile(pPath).Name                '
  lnameArch=lName
  lName = RusDosWin(lName,0)
  If Instr(lName, " ") > 0 Then lName = """" & lName & """"       ' ,
  If lPath <> "" Then lPath = lPath & "\"             ' ,
  If FSO.FileExists(lPath & CommFile) Then             ' descript.ion ,
    lText = FSO.OpenTextFile(lPath & CommFile).ReadAll          ' () descript.ion
    lComm = Filter(Split(lText, vbNewLine), lName & " ", True, 1)    '
    If UBound(lComm) > - 1 Then                '
      GetComment = Replace(Mid(lComm(0), Len(lName) + 2), "", "")    ' (Mid) (Replace) ""
      GetComment = Trim(Replace(GetComment, "\n", " "))
    Else
      GetComment = ""
    End If
  Else                            ' descript.ion
    GetComment = ""                      '
  End If
  GetComment=RusDosWin(GetComment,1)
End Function

'=========================================================================================================
Function RusDosWin(TextV, CodeV)
'  :
'  CodeV = 0 - DOS Windows
'        = 1 -
'  D - DOS (cp866)
'  W - Windows (cp1251)
'  :
'  ......
'============================================
Const D = "Ũ"
Const W = " 񦧨"
'           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
' ============================================
If CodeV = 0 Then
      RusDosWin = SymChange(TextV, W, D)
    Else
      RusDosWin = SymChange(TextV, D, W)
End If
'RusDosWin = D
End Function

Function SymChange(TextVal, NewCode, OldCode)
'    OldCode -> NewCode:
'  TextVal OldCode NewCode$
'  ! :  LEN(NewCode)=LEN(OldCode)
Dim Sym, PromText
Dim Ltext
Dim i, k
Sym = "" ' TextVal
Ltext = Len(TextVal)
If Ltext > 0 Then
    For i = 1 To Ltext
        PromText = Mid(TextVal, i, 1)             '
        If Asc(PromText) > 126 Then               ' 126 (.. )
       k = InStr(OldCode, PromText)           ' OldCode
            If k > 0 Then                         ', 0 (.. )
           Sym = Sym & Mid(NewCode, k, 1)          ', NewCode
       Else                   ' OldCode ,
      MsgBox " " & PromText & " "   '
       end if   
        Else                     ' 126
            Sym = Sym & PromText            '
        End If
    Next
End If
SymChange = Sym
End Function

- >
======================
: 78
: 18
:
======================
- W, - ( )
Back to top
View user's profile Send private message
Volniy



Joined: 15 Dec 2004
Posts: 585
Location:

Post (Separately) Posted: Thu Jun 10, 2010 02:22    Post subject: Reply with quote

WIN2DOS, . VBS . .

PS : DOS2WIN .
Back to top
View user's profile Send private message
Batya



Joined: 15 Dec 2004
Posts: 2218
Location: ,

Post (Separately) Posted: Thu Jun 10, 2010 10:53    Post subject: Reply with quote

AVos002 wrote:
:

, - , GetExtensionName?

.
, 2 :
1. - . .
2. descript.ion Windows-. - DOS?
_________________
, . .
Back to top
View user's profile Send private message
KarS



Joined: 21 Apr 2006
Posts: 102
Location: .

Post (Separately) Posted: Sun Nov 27, 2011 14:06    Post subject: Reply with quote

Batya
, .
! Very Happy Win7, MS Outlook 14.
. Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> Total Commander All times are GMT + 4 Hours
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group