썸네일 대표이미지 입니다.

형 변환 함수 – Classic ASP 언어 (1)

Classic ASP에서 제공하는 변환 함수를 사용하여 데이터 형을 변환할 수 있습니다.

ASP 내장 함수

1. 변환 함수

변환 함수기능
CIntInteger 타입으로 변환
CStrStirng 타입으로 변환
CLngLong 타입으로 변환
CDblDouble 타입으로 변환
CBoolTrue 또는 False로 변환
CDateDate 타입으로 변환
<% Option Explicit %>
     
<%
   Dim str_1, str_2
   Dim int_1, int_2

   str_1 = "123"
   str_2 = "456"

   int_1 = 123
   int_2 = 456

   Response.Write "[1] CStr - 문자열 합치기 : " & (CStr(int_1) + CStr(int_2)) & "</br>"

   Response.Write "[2] CInt - 두 수의 합 : " & (CInt(str_1) + CInt(str_2)) & "</br>"
   Response.Write "[3] CLng - 두 수의 합 : " & (CLng(str_1) + CLng(str_2)) & "</br>"
   Response.Write "[4] CDbl - 두 수의 합 : " & (CDbl(str_1) + CDbl(str_2)) & "</br>"

   Response.Write "[5] CBool : " & CBool(int_1 > int_2) & "</br>"
   Response.Write "[6] CDate : " & CDate("2021-12-25") & "</br>"
%>
실행 화면입니다.

관련 이전 게시글


이 글이 도움이 되셨다면 공유를 부탁드립니다. 다음 글에서 뵙겠습니다!

위로 스크롤